Need help with jail timer - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need help with jail timer (
/showthread.php?tid=437938)
Need help with jail timer -
GwENiko - 18.05.2013
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:
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;
}
help plz.
Re: Need help with jail timer -
edgargreat - 18.05.2013
What do you mean not respawned all? They're not getting out on jail after 1 minute?
Re: Need help with jail timer -
Guest123 - 18.05.2013
pawn Код:
SetTimerEx("UnJail",80000,0,"i",pID);//80000 1 minute i think
pawn Код:
forward UnJail(playerid);
public UnJail(playerid)
{
pjailed[playerid] = 0;
SpawnPlayer(playerid);
return 1;
}
Re: Need help with jail timer -
GwENiko - 18.05.2013
Guest123's post solved my issue, thanks for the quick help!!
Re: Need help with jail timer -
Guest123 - 18.05.2013
okay, no problem