09.07.2011, 07:50
Or if you want to use zcmd+sscanf:
pawn Код:
COMMAND:jail(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
new Player;
if(PlayerInfo[playerid][AdminLevel] >= 5)
else if (sscanf(params, "u", Player)) return SendClientMessage(playerid, 0xFFFF00FF, "Usage: /jail [PlayerID]");
else if (Player == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not found!");
{
format(string, sizeof(string), "Admin %s has Placed %d in jail!", pname);
SendClientMessageToAll(Red, string);
SetPlayerPos(playerid,265.0000, 82.0000, 1002.0000);
SendClientMessage(playerid,0x00FFFFAA,"%s has placed you in jail!");
new Float:pX, Float:pY, Float:pZ;
PlayerPlaySound(playerid,1057,pX,pY,pZ);
}
return 1;
}
else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command.");
}
else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected.");
}