18.05.2013, 00:56
I don't know what i am doing wrong, but as far as i try to jail someone for 1 minute, after 1 minute they're not getting respawned at all, here's the code:
help plz.
pawn Код:
CMD:jail(playerid, params[])
{
new pID, pTI, reason[100], aname[MAX_PLAYER_NAME], pname[MAX_PLAYER_NAME], string[128];
if(sscanf(params, "uds[128]", pID, pTI, reason)) return SendClientMessage(playerid, 0xFF0000AA, "[USAGE] /jail <playerid> <time> <reason>.");
if(pInfo[playerid][Level] < 3) return 0;
if(pInfo[playerid][Level] < 2) return SendClientMessage(playerid, 0xFF0000AA, "[ERROR] You are not authorized to use this command.");
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, 0xFF0000AA, "[ERROR]: User is not connected.");
if(pjailed[pID] == 1) return SendClientMessage(playerid, 0xFF0000AA, "[ERROR] User is currently in jail.");
{
GetPlayerName(playerid, aname, sizeof(aname));
GetPlayerName(pID, pname, sizeof(pname));
format(string, sizeof(string), "[ADMIN] You have admin jailed %s for: %s.", pname, reason);
SendClientMessage(playerid, 0xFFFF00AA, string);
format(string, sizeof(string), "You have been admin jailed by %s for: %s.", aname, reason);
SendClientMessage(pID, 0xFFFF00AA, string);
format(string, sizeof(string), "[ADMIN] %s has admin jailed %s for: %s.", aname, pname, reason);
SendClientMessageToAll(0xFFFF00AA, string);
SetPlayerPos(pID, 2334.1631,1459.6666,2114.5259);
SetPlayerInterior(pID, 0);
SetPlayerFacingAngle(pID, 360.0);
SetPlayerHealth(pID, 99999999999999999.0);
ResetPlayerWeapons(pID);
jtime[pID] = SetTimerEx("UnJail", pTI*1000*60,0, "i", pID);
pjailed[playerid] = 1;
}
return 1;
}