19.04.2009, 02:27
pawn Код:
//Top of script
new Muted[MAX_PLAYERS];
pawn Код:
public OnPlayerText(playerid, text[])
{
if(Muted[playerid] == 1)
{
SendClientMessage(playerid, RED, " You are muted and cannot talk. ");
return 0;
}
return 1;
}
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new tmp[256];
new idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, " /mute ", true) == 0)
{
if(IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, color, " Usage: /mute [id] ");
new giveplayerid = strval(tmp);
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, color, " Player not connected ! ");
new name[24], name2[24], str[128];
GetPlayerName(playerid, name, 24);
GetPlayerName(giveplayerid, name2, 24);
format(str, sizeof str, " Administrator %s has muted %s ", name, name2);
SendClientMessageToAll(color, str);
Muted[giveplayerid] = 1;
return 1;
}
else return SendClientMessage(playerid, color, " Not an administrator! ");
}
return 0;
}