02.01.2011, 11:04
Well
pawn Код:
#define isnull(%1) \
((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
pawn Код:
dcmd_mute(playerid,params[])
{
new giveplayerid;
if(pInfo[playerid][Adminlvl] < Moderator) return SendClientMessage(playerid,COLOR_RED,"You Have To Be Admin Level 1 To Use This Command");
if(isnull(params)) return SendClientMessage(playerid, COLOR_RED,"Usage: /mute [playerid]");
if(giveplayerid == playerid) return SendClientMessage(playerid,COLOR_RED,"You Can't Mute Urself");
if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"User Doesn't Exist");
if(pInfo[giveplayerid][Muted] == 1) return SendClientMessage(playerid,COLOR_RED,"Player Already Muted");
new pid[MAX_PLAYER_NAME],pName[MAX_PLAYER_NAME];
GetPlayerName(giveplayerid,pid,MAX_PLAYER_NAME);
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
new string[128]; format(string,128,"You Muted %s",pid);
SendClientMessage(playerid,COLOR_YELLOW,string);
format(string,128,"You've Been Muted By %s",pName);
SendClientMessage(giveplayerid,COLOR_RED,string);
pInfo[giveplayerid][Muted] = 1;
return 1;
}