27.07.2012, 15:04
pawn Код:
new Freeze[MAX_PLAYERS];
CMD:freeze2(playerid, params[])
{
new id;
new msg[50], string[128], string1[128], string2[128];
if(Freeze[playerid] == 1)
{
SendClientMessage(playerid,COLOR_RED,"That Player is already in Frozen Mode!");
}
if(sscanf(params,"us[50]",id,msg)) return SendClientMessage(playerid, -1, "Usage: /freeze [id] [reason]");
else if(id == playerid) return SendClientMessage(playerid, COLOR_YELLOW, "Error: You cannot use this command on yourself");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_YELLOW, "Error: This player is not connected");
else
{
TogglePlayerControllable(id,0);
SetPVarInt(id,"freeze",1);
format(string, sizeof(string), "You have frozen %s for reason: %s", PlayerName(id),msg);
SendClientMessage(playerid, COLOR_GREEN, string);
format(string1, sizeof(string1), "You have been frozen by Admin, reason: %s", msg);
SendClientMessage(id, COLOR_RED, string1);
format(string2, sizeof(string2), "%s has been frozen by Admin (%s)", PlayerName(id), msg);
SendClientMessageToAll(COLOR_RED, string2);
Freeze[playerid] = 1;
}
return 1;
}