15.06.2013, 09:08
pawn Код:
dcmd_jail(playerid,params[])
{
new string[128];
new ID;
new cmdtime;
new cmdreason[100];
if(sscanf(params,"ui",ID,cmdtime,cmdreason))
{
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /jail [Player ID] [Seconds] [Reason]");
return 1;
}
if(!IsPlayerConnected(ID))
{
format(string,sizeof(string),"The player ID [%d] is not connected to the server. You cannot jail them.");
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
if(IsSpawned[ID] != 1)
{
format(string,sizeof(string),"%s[%d] is not spawned. You cannot jail them.");
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
format(string,sizeof(string),"{FF0000}[ADMIN] {FFFFFF}%s[%d] has jailed %s[%d] for %d seconds. Reason: %s.",PlayerName(playerid),playerid,PlayerName(ID),ID,cmdtime,cmdreason);
SendClientMessageToAll(COLOR_WHITE,string);