15.03.2014, 22:39
Need some help with my jail command, the player doesn't get released after he gets jailed, also i have textdraws that i want to set as a timer (so it shows for the player) when unjail it will disapear,
pawn Код:
CMD:jail(playerid, params[])
{
new pID;
new string[128];
new time, reason[128];
if (sscanf(params, "udS", pID, time, reason)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /jail (Nick/ID) (Seconds) (Reason)");
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "This Player Is Not Connected.");
if(pID == cellmin) return SendClientMessage(playerid, COLOR_RED, "Multiple Players Found. Please Be More Specific.");
if(pID == playerid) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command On Yourself.");
if(Dead[pID] == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command On A Dead Player.");
if(Jailed{pID} == true) return SendClientMessage(playerid, COLOR_RED, "This Player Is Already Jailed.");
format(string, sizeof string, "JAIL: %s (%d) (JAIL) %s", PlayerName(pID));
SendClientMessageToAll(COLOR_PINK, string);
GameTextForPlayer(pID, "~w~busted by an ~r~admin", 3500, 3);
SetPVarInt(pID, "IsJailed", 1);
Jailed{pID} = true;
SetPlayerInterior(pID, 3);
SetPlayerPos(pID, 198.0666,175.6295,1003.0234);
ResetPlayerWeapons(pID);
return 1;
}