03.08.2009, 07:31
To top:
Command:
Under onplayercommandtext:
pawn Код:
new Muted[MAX_PLAYERS];
pawn Код:
if(!strcmp(cmdtext, "/mute", true, 5))
{
if(!strlen(cmdtext[6]))
{
SendClientMessage(playerid, COLOR_ORED, "Usage: /mute [playerid]");
return 1;
}
new ID = strval(cmdtext[6]);
new pName[24], str[64];
if(IsPlayerConnected(ID))
{
GetPlayerName(ID, pName, 24);
format(str, 64, "%s has been muted", pName);
SendClientMessageToAll(COLOR_COLOR, str);
print(str);
Muted[playerid] = 1;
}
return 1;
}
pawn Код:
if(Muted[playerid] == 1)
{
SendClientMessage(playerid, COLOR_COLOR, "Error: You cannot use commands while muted!");
return 0;
}