Originally Posted by grand.Theft.Otto
Oops, for the green //commented lines , I put mute/unmute command, I meant freeze/unfreeze
For the freeze command:
pawn Код:
COMMAND:freeze(playerid, params[]) { if(MasterAccount[playerid][mSuperAdmin] || Character[playerid][cAdminLevel] >= 1) { if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "[SYNTAX]: : /freeze [playerid]"); if(!IsPlayerConnected(playerb)) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: Invalid player id"); if(IsFrozen[playerb]) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: Player is already frozen.");
IsFrozen[playerb] = 1;
GetPlayerPos(playerb, FX[playerb], FY[playerb], FZ[playerb]);
SendClientMessage(playerb, COLOR_RED, "[INFO]: You have been frozen!"); new string[128], name[24]; GetPlayerName(playerb,name,24); // getting the name of the target (playerb) format(string,128,"You Have Successfully Frozen Player %s (%d)",name,playerb); // name, id of playerb SendClientMessage(playerid,-1,string); // sending the above message to the admin } return 1; }
For the unfreeze command:
pawn Код:
new string[128], name[24];
GetPlayerName(playerb,name,24); // getting the name of the target (playerb)
format(string,128,"You Have Successfully Unfrozen Player %s (%d)",name,playerb); // name, id of playerb SendClientMessage(playerid,-1,string);
^ Put that in the /unfreeze command, just like I did in your /freeze command
|