23.07.2015, 15:01
PHP код:
CMD:freeze(playerid, params[])
{
if(pInfo[playerid][AdminLevel] >= 1) return SendClientMessage(playerid, -1, "{FF0000}[SYSTEM ERROR]: You don't have the privilege to use that command.");
{
new id, name[128], string[128];
if(pInfo[playerid][Logged] == 0) return SendClientMessage(playerid, -1, "{FF0000}[SYSTEM[: {FFFFFF}You have to login before you can use commands !");
if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "{FF0000}[SYSTEM ERROR]: {FFFFFF}USAGE: /freeze [id]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "{FF0000}[SYSTEM ERROR]: The ID you have inputted is incorrect !");
PlayerPlaySound(playerid,6400,0.0,0.0,0.0);
TogglePlayerControllable(id, 0);
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
format(string,sizeof string,"You have freezed %s",name);
SendClientMessageToAll(-1, string);
format(string,sizeof string, "{FF0000}[SYSTEM]: You have been frozen by {FFFF00}%s",name);
}
return 1;
}