15.12.2013, 14:27
thanks all and here is my jail command.
pawn Код:
CMD:jail(playerid,params[])
{
new targetid,reason[50],string[128],minutes;
if(!IsPlayerAdmin(playerid)) return 0;
if(sscanf(params, "uds[50]", targetid, minutes, reason))return SendClientMessage(playerid, COLOR_WHITE, "/jail [playerid/name] [time in minutes] [reason]");
if(!IsPlayerConnected(targetid))return SendClientMessage(playerid, COLOR_WHITE, "Error: This player is not connected.");
if(Spawned[targetid] == 0) return SendClientMessage(playerid,COLOR_WHITE,"Error: This Player Is Not Spawned.");
if(PlayerInfo[targetid][pJailed] == 1) return SendClientMessage(playerid,COLOR_WHITE,"Error: This player is already in jail.");
else
{
new calc = minutes*60;
PlayerInfo[targetid][pJailTime] = calc;
PlayerInfo[targetid][pAdminJailed] = 1;
ResetPlayerWeapons(targetid);
SetPlayerScore(targetid,GetPlayerScore(targetid)-1);
GameTextForPlayer(targetid,"~r~JAILED!",7000,4);
PutPlayerInJail(targetid);
format(string, sizeof(string), "%s(%d) has been Jailed by an Administrator - Reason: %s", GetName(targetid), targetid, reason);
SendClientMessageToAll(COLOR_WHITE,string);
Releaser[targetid] = SetTimerEx("JailTime",calc*1000, false, "i", targetid);
}
return 1;
}