Timer Problem. - 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: Timer Problem. (
/showthread.php?tid=210956)
Timer Problem. -
GaB1TzZzu - 14.01.2011
Code:
forward unfreezetimer(playerid);
public unfreezetimer(playerid)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pJailed] == 1)
{
TogglePlayerControllable(playerid, 1);
return true;
}
}
return true;
}
And at the command i put:
Code:
SetTimerEx("unfreezetimer",2000,0,"d",playerid);
The problem: I get freeze but i don't get unfreeze after 2 seconds..
Re: Timer Problem. -
Infamous - 14.01.2011
If the timer is activated by a variable you should set the timer to repeat every so often and then reset the variable. Proberly a better way of doing it.
Re: Timer Problem. -
hadzx - 14.01.2011
i dont get why you do settimerex because i use settimer it works fine for me
Re: Timer Problem. -
GaB1TzZzu - 14.01.2011
No work. Another solution.
@hadzx: i did'n see your reply. I will test now.
Re: Timer Problem. -
GaB1TzZzu - 14.01.2011
I've tested, no work.. Same thing.. I don't get unfreeze.
Re: Timer Problem. -
Infamous - 14.01.2011
Quote:
Originally Posted by hadzx
i dont get why you do settimerex because i use settimer it works fine for me 
|
He has a param within his callback, so it is easier to use SetTimerEx.
Quote:
Originally Posted by GaB1TzZzu
No work. Another solution.
|
The problem must lie within the variable you are checking. Make sure it is being set to '1' before the timer to unfreeze the player is activated.
Re: Timer Problem. -
GaB1TzZzu - 14.01.2011
Quote:
Originally Posted by Infamous
The problem must lie within the variable you are checking. Make sure it is being set to '1' before the timer to unfreeze the player is activated.
|
I don't understand what you said..
Re: Timer Problem. -
Infamous - 14.01.2011
Quote:
Originally Posted by GaB1TzZzu
I don't understand what you said..
|
Are you setting this bit (Code Below) to 1 before you run your timer?
pawn Code:
if(PlayerInfo[playerid][pJailed] == 1)
Re: Timer Problem. -
hadzx - 14.01.2011
just tryed a settimer instead of settimerex nd i got a error playerid undefined so

timers dont work for me now lol
Re: Timer Problem. -
GaB1TzZzu - 14.01.2011
I edited to:
Code:
public unfreezetimer(playerid)
{
TogglePlayerControllable(playerid, 1);
return true;
}
No work..
Re: Timer Problem. -
hadzx - 14.01.2011
ffs i keep gettin this error
Код:
: warning 235: public function lacks forward declaration (symbol "message")
Re: Timer Problem. -
GaB1TzZzu - 14.01.2011
Wrong topic?
Re: Timer Problem. -
hadzx - 14.01.2011
Quote:
Originally Posted by GaB1TzZzu
Wrong topic?
|
naw i tryed his code and then tryed it a different way lol
EDIT: yeah the way i tryed worked