• 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!

Fix/Patch Resize messages in certain channels

Jetro

jangeldev
Joined
Aug 1, 2011
Messages
452
Reaction score
68
Location
Venezuela
In some servers with low exp in certain chat channels is not allowed write with "CAPS LOCK ON", this fix that, it resizes the message before send it to certain channel:

go to game.cpp
add this before function Game::playerSay:
[cpp]bool needFix(Player* player, uint16_t channelId){
uint16_t channels [] = {4, 7, 9};
uint16_t size = sizeof(channels) / sizeof(channels[0]);
for (uint16_t i = 0; i < size; i++)
{
if (channelId == channels && !player->hasFlag(PlayerFlag_CannotBeMuted))
return true;

}
return false;
}[/cpp]

then find:
[cpp]if(playerSpeakToChannel(player, type, text , channelId, statementId))[/cpp]

and replace with:
[cpp]if(playerSpeakToChannel(player, type, (needFix(player, channelId) ? asLowerCaseString(text): text) , channelId, statementId))
[/cpp]

you may add more channelIds at this line:
[cpp]uint16_t channels [] = {4, 7, 9};[/cpp]
 
Back
Top