JailTimer
#1

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
Reply
#2

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
Reply
#3

I want minutes to lol
Reply
#4

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;
Reply
#5

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


Forum Jump:


Users browsing this thread: 1 Guest(s)