03.08.2009, 06:56
I need a command to mute player that he could not do any commands
Can you help me?
Can you help me?
new Muted[MAX_PLAYERS];
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;
}
if(Muted[playerid] == 1)
{
SendClientMessage(playerid, COLOR_COLOR, "Error: You cannot use commands while muted!");
return 0;
}