• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

OTClient Hide and Show message orange - cast spell

roriscrave

Advanced OT User
Joined
Dec 7, 2011
Messages
1,188
Solutions
34
Reaction score
200
When have a lot of people on screen, and all are casting spells, i get a lot of spam in the screen (spells orange message).
How can i make a code to player can select show/hide the orange spell message?
Or can select transparency for this message?
 
Solution
If you want to hide, here is how to:
C++:
int32_t key = 1000, value = 0;
player->getStorageValue(key, value);

if (value == 1) {
    SpectatorVec spectators; spectators.emplace_back(player);
    return internalCreatureSay(player, TALKTYPE_MONSTER_SAY, words, false, &spectators);
} else {
    return internalCreatureSay(player, TALKTYPE_MONSTER_SAY, words, false);
}


Personally I would use a member variable instead a storage but it's ok too.
game.cpp

Code:
bool Game::playerSaySpell(Player* player, SpeakClasses type, const std::string& text)
reeemplace
Lua:
return internalCreatureSay(player, TALKTYPE_SAY, words, false);
to
Code:
return true;
 
Last edited:
game.cpp

Code:
bool Game::playerSaySpell(Player* player, SpeakClasses type, const std::string& text)
remplace
Lua:
return internalCreatureSay(player, TALKTYPE_SAY, words, false);
to
Code:
return true;
reMplace? kk

I'll test! Is possible make this message transparency?
 
is possible hide only for another uses?
exemple: player A use: "exura vita". Only player A will see this message orange.
 
If you want to hide, here is how to:
C++:
int32_t key = 1000, value = 0;
player->getStorageValue(key, value);

if (value == 1) {
    SpectatorVec spectators; spectators.emplace_back(player);
    return internalCreatureSay(player, TALKTYPE_MONSTER_SAY, words, false, &spectators);
} else {
    return internalCreatureSay(player, TALKTYPE_MONSTER_SAY, words, false);
}


Personally I would use a member variable instead a storage but it's ok too.
 
Solution
Back
Top