Originally Posted by
Adrien
And someone has a mute/unmute command, coz 'im tired to kick shits who spams...
PHP Code:
CodeCallBack_PlayerCommand(args)
{
/*
player connected:
if (!isDefined(self.isMute))
self.isMute = false;
*/
if (args[0] == "say" || args[0] == "say_team") // + isDefined args[1] + more checks
{
if (self.isMute)
{
self iprintlnbold("you muted :(");
return;
}
if (args[1] == "!mute")
{
player = findPlayer_byStr(args[2]);
if (isDefined(player))
player.isMute = true;
}
if (args[1] == "!unmute")
{
player = findPlayer_byStr(args[2]);
if (isDefined(player))
player.isMute = false;
}
}
}
general example, need to add:
- Need check for some null args array
- Mute stored in the player's structure (reconnection will break "mute"): need remake for level. (for map) or db (for time and more...)
- Mute no work for quick messages (V1 V2 V3)
- well, I forgot something else