Posts: 1,018
Threads: 320
Joined: Jul 2010
Hello I have set a timer when is player prisoned (/prison) and when the player is in prison he get textdraw how much time is in jail Jailed: and here is in textdraw seconds
but the problem is know I prison myself on 10 min which is 600 seconds and when I prisoned the timer goes like
598 596 594 always for two seconds at once if you know what I mean. How can I make that timer goes like
599 598 597 596 etc...
Thanks.
Posts: 1,018
Threads: 320
Joined: Jul 2010
JailTimer[playerid] = SetTimerEx("JailTimerLeft",1000,1,"d",playerid); // this is for setting timer for one player .
Posts: 515
Threads: 5
Joined: Jun 2007
Reputation:
0
You are lowering the amount of seconds with 2 each time...
Posts: 1,018
Threads: 320
Joined: Jul 2010
how you mean isn't it 1000 - 1 second
? Thanks
Posts: 515
Threads: 5
Joined: Jun 2007
Reputation:
0
No, i mean the value. If it's showing as 598 596 594 592 it looks like is subtracting 2 seconds...
Show us the code..
Posts: 1,018
Threads: 320
Joined: Jul 2010
in public JailTimeLeft is
pawn Код:
forward JailTimerLeft(playerid);
public JailTimerLeft(playerid)
{
if(PlayerInfo[playerid][pJailed] != 0)
{
PlayerInfo[playerid][pJailTime] -= 1;
new string[128];
format(string,sizeof(string),"%d",PlayerInfo[playerid][pJailTime]);
TextDrawSetString(Text2,string);
TextDrawShowForPlayer(playerid,Text:Text1);
TextDrawShowForPlayer(playerid,Text:Text2);
}
else
{
KillTimer(JailTimer[playerid]);
TextDrawHideForPlayer(playerid,Text:Text1);
TextDrawHideForPlayer(playerid,Text:Text2);
}
return 1;
}
Posts: 28
Threads: 4
Joined: Feb 2014
Reputation:
0
Where did you put you SetTimer or SetTimerEx function?
Posts: 1,018
Threads: 320
Joined: Jul 2010