SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 14/01/2011, 09:50 AM   #1
GaB1TzZzu
Huge Clucker
 
Join Date: Jul 2010
Posts: 236
Reputation: 0
Default Timer Problem.

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..
GaB1TzZzu is offline  
Old 14/01/2011, 09:54 AM   #2
Infamous
Gangsta
 
Infamous's Avatar
 
Join Date: May 2009
Location: Essex, England
Posts: 663
Reputation: 65
Default Re: Timer Problem.

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.
Infamous is offline  
Old 14/01/2011, 10:16 AM   #3
hadzx
Huge Clucker
 
hadzx's Avatar
 
Join Date: Mar 2008
Posts: 396
Reputation: 0
Default Re: Timer Problem.

i dont get why you do settimerex because i use settimer it works fine for me
__________________
hadzx is offline  
Old 14/01/2011, 10:20 AM   #4
GaB1TzZzu
Huge Clucker
 
Join Date: Jul 2010
Posts: 236
Reputation: 0
Default Re: Timer Problem.

No work. Another solution.

@hadzx: i did'n see your reply. I will test now.
GaB1TzZzu is offline  
Old 14/01/2011, 10:26 AM   #5
GaB1TzZzu
Huge Clucker
 
Join Date: Jul 2010
Posts: 236
Reputation: 0
Default Re: Timer Problem.

I've tested, no work.. Same thing.. I don't get unfreeze.
GaB1TzZzu is offline  
Old 14/01/2011, 10:36 AM   #6
Infamous
Gangsta
 
Infamous's Avatar
 
Join Date: May 2009
Location: Essex, England
Posts: 663
Reputation: 65
Default Re: Timer Problem.

Quote:
Originally Posted by hadzx View Post
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 View Post
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.
Infamous is offline  
Old 14/01/2011, 10:41 AM   #7
GaB1TzZzu
Huge Clucker
 
Join Date: Jul 2010
Posts: 236
Reputation: 0
Default Re: Timer Problem.

Quote:
Originally Posted by Infamous View Post
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..
GaB1TzZzu is offline  
Old 14/01/2011, 10:45 AM   #8
Infamous
Gangsta
 
Infamous's Avatar
 
Join Date: May 2009
Location: Essex, England
Posts: 663
Reputation: 65
Default Re: Timer Problem.

Quote:
Originally Posted by GaB1TzZzu View Post
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)
Infamous is offline  
Old 14/01/2011, 10:53 AM   #9
hadzx
Huge Clucker
 
hadzx's Avatar
 
Join Date: Mar 2008
Posts: 396
Reputation: 0
Default Re: Timer Problem.

just tryed a settimer instead of settimerex nd i got a error playerid undefined so timers dont work for me now lol
__________________
hadzx is offline  
Old 14/01/2011, 10:58 AM   #10
GaB1TzZzu
Huge Clucker
 
Join Date: Jul 2010
Posts: 236
Reputation: 0
Default Re: Timer Problem.

I edited to:

Code:
public unfreezetimer(playerid)
{
	TogglePlayerControllable(playerid, 1);
	return true;
}
No work..
GaB1TzZzu is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Timer problem LZLo Help Archive 4 24/12/2010 08:36 PM
Timer Problem yeswecanchange09 Help Archive 3 12/06/2010 03:26 PM
Timer problem Mechscape Help Archive 16 08/06/2010 12:00 PM
Timer Problem nesty Help Archive 3 04/02/2009 12:35 AM


All times are GMT. The time now is 01:53 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.