SA-MP Forums Archive
JailTimer - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: JailTimer (/showthread.php?tid=255634)



JailTimer - Admigo - 16.05.2011

Heey guys,

I want to make a textdraw for the jail in minutes and seconds but i dont know how i can make it.
Can someone help me?
I already have an arrest command.

Thanks Admigo


Re: JailTimer - park4bmx - 16.05.2011

OK so,
I would show u and example

pawn Код:
//at the top
new JailTimer[MAX_PLAYERS];
new JailSeconds[MAX_PLAYERS];

//then where your comamdn is
JailTimer[playerid] = SetTimer("PlayerJailTimer", 1000, true);
JailSeconds[playerid]= 60;  //this is 60 seconds change it to what ever time u want in Seconds

//then put this in the bottum of ur script
foward PlayerJailTimer()
public PlayerJailTimer()
{
for(new playerid; playerid < MAX_PLAYERS; playerid ++)
{
JailSeconds[playerid]--;
if(JailSeconds[playerid]==0)
{
KillTimer(JailTimer[playerid])
SetPlayerPos(playerid,0,0,0); //and just finish the script where u want the player to spawn etc..
}
}
return 1;
}
Tell me if it works


Re: JailTimer - Admigo - 16.05.2011

I want minutes to lol


Re: JailTimer - park4bmx - 16.05.2011

well easy just
60 seconds = 1 minute
120 seconds = 2minutes

EXAMPLE
if u want like 5 minutes which = 300 seconds Then change this
JailSeconds[playerid]= 60;
TO this
JailSeconds[playerid]= 300;


Re: JailTimer - Admigo - 16.05.2011

I know lol but i want add minutes to lol. Can i not make a count if seconds60 = 1min?count--