• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

How to remove You were healed by

Lopaskurwa

Well-Known Member
Joined
Oct 6, 2017
Messages
936
Solutions
2
Reaction score
57
So how to remove that text when you heave been healed i tried to close lines but i get errors something about } probably im closing it wrong
C++:
            SpectatorVec list;
            map.getSpectators(list, targetPos, false, true);
            for (Creature* spectator : list) {
                Player* tmpPlayer = spectator->getPlayer();
                if (tmpPlayer == attackerPlayer && attackerPlayer != targetPlayer) {
                  
                    message.type = MESSAGE_STATUS_DEFAULT;
                    message.text = "You heal " + target->getNameDescription() + " for " + damageString;
                } else if (tmpPlayer == targetPlayer) /*{
                    message.type = MESSAGE_STATUS_DEFAULT;
                    if (!attacker) {
                        message.text = "You were healed for " + damageString;
                    } else if (targetPlayer == attackerPlayer) {
                        message.text = "You heal yourself for " + damageString;
                    } else {
                        message.text = "You were healed by " + attacker->getNameDescription() + " for " + damageString;
                    }
                } else {
                    message.type = MESSAGE_STATUS_DEFAULT;
                    message.text = spectatorMessage;
                }
                tmpPlayer->sendTextMessage(message); */
            }
        }
 
Solution
Just comment the line where it sends the message to the client?

C++:
            SpectatorVec list;
            map.getSpectators(list, targetPos, false, true);
            for (Creature* spectator : list) {
                Player* tmpPlayer = spectator->getPlayer();
                if (tmpPlayer == attackerPlayer && attackerPlayer != targetPlayer) {
              
                    message.type = MESSAGE_STATUS_DEFAULT;
                    message.text = "You heal " + target->getNameDescription() + " for " + damageString;
                } else if (tmpPlayer == targetPlayer) {
                    message.type = MESSAGE_STATUS_DEFAULT;
                    if (!attacker) {
                        message.text = "You were healed for " +...
Delete or comment entire that code to no show messages, the function of that piece of code is entire to show the message to yourself and the spectators then delete it.

PHP:
/*    
 SpectatorVec list;
            map.getSpectators(list, targetPos, false, true);
            for (Creature* spectator : list) {
                Player* tmpPlayer = spectator->getPlayer();
                if (tmpPlayer == attackerPlayer && attackerPlayer != targetPlayer) {
                 
                    message.type = MESSAGE_STATUS_DEFAULT;
                    message.text = "You heal " + target->getNameDescription() + " for " + damageString;
                } else if (tmpPlayer == targetPlayer) 
                    message.type = MESSAGE_STATUS_DEFAULT;
                    if (!attacker) {
                        message.text = "You were healed for " + damageString;
                    } else if (targetPlayer == attackerPlayer) {
                        message.text = "You heal yourself for " + damageString;
                    } else {
                        message.text = "You were healed by " + attacker->getNameDescription() + " for " + damageString;
                    }
                } else {
                    message.type = MESSAGE_STATUS_DEFAULT;
                    message.text = spectatorMessage;
                }
                tmpPlayer->sendTextMessage(message); 
            }
        }
*/
 
Last edited:
Delete or comment entire that code to no show messages, the function of that piece of code is entire to show the message to yourself and the spectators then delete it.

PHP:
/*   
 SpectatorVec list;
            map.getSpectators(list, targetPos, false, true);
            for (Creature* spectator : list) {
                Player* tmpPlayer = spectator->getPlayer();
                if (tmpPlayer == attackerPlayer && attackerPlayer != targetPlayer) {
                
                    message.type = MESSAGE_STATUS_DEFAULT;
                    message.text = "You heal " + target->getNameDescription() + " for " + damageString;
                } else if (tmpPlayer == targetPlayer)
                    message.type = MESSAGE_STATUS_DEFAULT;
                    if (!attacker) {
                        message.text = "You were healed for " + damageString;
                    } else if (targetPlayer == attackerPlayer) {
                        message.text = "You heal yourself for " + damageString;
                    } else {
                        message.text = "You were healed by " + attacker->getNameDescription() + " for " + damageString;
                    }
                } else {
                    message.type = MESSAGE_STATUS_DEFAULT;
                    message.text = spectatorMessage;
                }
                tmpPlayer->sendTextMessage(message);
            }
        }
*/
Tried this way to it gives a lot of errors in vs. Example:
Code:
1>  ..\src\game.cpp(3587): note: this line contains a '{' which has not yet been matched
1>..\src\game.cpp(4708): error C2601: 'Game::addGuild': local function definitions are illegal
1>  ..\src\game.cpp(3587): note: this line contains a '{' which has not yet been matched
1>..\src\game.cpp(4713): error C2601: 'Game::removeGuild': local function definitions are illegal
1>  ..\src\game.cpp(3587): note: this line contains a '{' which has not yet been matched
1>..\src\game.cpp(4718): error C2601: 'Game::internalRemoveItems': local function definitions are illegal
1>  ..\src\game.cpp(3587): note: this line contains a '{' which has not yet been matched
1>..\src\game.cpp(4737): error C2601: 'Game::getBedBySleeper': local function definitions are illegal
1>  ..\src\game.cpp(3587): note: this line contains a '{' which has not yet been matched
1>..\src\game.cpp(4746): error C2601: 'Game::setBedSleeper': local function definitions are illegal
1>  ..\src\game.cpp(3587): note: this line contains a '{' which has not yet been matched
1>..\src\game.cpp(4751): error C2601: 'Game::removeBedSleeper': local function definitions are illegal
1>  ..\src\game.cpp(3587): note: this line contains a '{' which has not yet been matched
1>..\src\game.cpp(4759): error C2601: 'Game::getUniqueItem': local function definitions are illegal
1>  ..\src\game.cpp(3587): note: this line contains a '{' which has not yet been matched
1>..\src\game.cpp(4768): error C2601: 'Game::addUniqueItem': local function definitions are illegal
1>  ..\src\game.cpp(3587): note: this line contains a '{' which has not yet been matched
 
Just comment the line where it sends the message to the client?

C++:
            SpectatorVec list;
            map.getSpectators(list, targetPos, false, true);
            for (Creature* spectator : list) {
                Player* tmpPlayer = spectator->getPlayer();
                if (tmpPlayer == attackerPlayer && attackerPlayer != targetPlayer) {
              
                    message.type = MESSAGE_STATUS_DEFAULT;
                    message.text = "You heal " + target->getNameDescription() + " for " + damageString;
                } else if (tmpPlayer == targetPlayer) {
                    message.type = MESSAGE_STATUS_DEFAULT;
                    if (!attacker) {
                        message.text = "You were healed for " + damageString;
                    } else if (targetPlayer == attackerPlayer) {
                        message.text = "You heal yourself for " + damageString;
                    } else {
                        message.text = "You were healed by " + attacker->getNameDescription() + " for " + damageString;
                    }
                } else {
                    message.type = MESSAGE_STATUS_DEFAULT;
                    message.text = spectatorMessage;
                }
                //tmpPlayer->sendTextMessage(message);
            }
        }
 
Solution
Back
Top