29.11.2011, 15:18
Hi there, this code works fine until someone is actually muted, it will then ignore all the code and return messages as normal as if there was no code under OnPlayerText at all. I want muted players to get the message "You are currently muted and cannot type in the chatbox." and nothing else.
Any one got an idea?
pawn Код:
public OnPlayerText(playerid, text[])
{
if(Muted[playerid] == 1)
return SendClientMessage(playerid, COLOR_ERROR, "You are currently muted and cannot type in the chatbox.");
else if(Muted[playerid] == 0)
{
new string[128], playername[MAX_PLAYER_NAME];
new PlayerColor = GetPlayerColor(playerid);
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "%s[%d]: {FFFFFF}%s", playername, playerid, text);
SendClientMessageToAll(PlayerColor, string);
}
return 0;
}