SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 30/12/2010, 12:00 PM   #1
juuleman
Gangsta
 
juuleman's Avatar
 
Join Date: Feb 2009
Location: The Netherlands
Posts: 507
Reputation: 0
Default Timers with playerid

Hey Guys,

So, i have somewhere in my script something like this:

pawn Code:
TogglePlayerControllable(playerid,false);//Preventing players falling true the objects at self made interiors.
SetTimer("HouseTimer",1000,false);

And somewhere else (the timer) this:

pawn Code:
public HouseTimer(playerid)
{
   TogglePlayerControllable(playerid,true);
}

Now, i already expected this to happen but i don't know how to fix it, when at HouseTimer it says it should make the player move again but it only does that for playerid 0, is there any way how i could make this work properly to all id's?

Best Regards,
SancheZ
__________________
juuleman is offline  
Old 30/12/2010, 12:02 PM   #2
Macluawn
Gangsta
 
Macluawn's Avatar
 
Join Date: Aug 2010
Location: Latvia
Posts: 613
Reputation: 78
Default Re: Timers with playerid

Use few variables, example:
playerfrozen[playerid] = 1;
and at timer
for(....)
{
playerfrozen = 0;
tooglecontrable 1
}

This is not the best way to do it, but should get the job done. Its just an example, dont just copy&paste it.
Macluawn is offline  
Old 30/12/2010, 12:06 PM   #3
juuleman
Gangsta
 
juuleman's Avatar
 
Join Date: Feb 2009
Location: The Netherlands
Posts: 507
Reputation: 0
Default Re: Timers with playerid

Quote:
Originally Posted by Macluawn View Post
Use few variables, example:
playerfrozen[playerid] = 1;
and at timer
for(....)
{
playerfrozen = 0;
tooglecontrable 1
}

This is not the best way to do it, but should get the job done. Its just an example, dont just copy&paste it.
Yeah i understand. Pretty strange it's the only way to do it.

Thank you!
__________________
juuleman is offline  
Old 30/12/2010, 12:07 PM   #4
JamesC
Huge Clucker
 
JamesC's Avatar
 
Join Date: Jul 2010
Location: New Zealand
Posts: 239
Reputation: 31
Default Re: Timers with playerid

pawn Code:
SetTimerEx( "HouseTimer", 1000, false, "i", playerid );
__________________


JamesC is offline  
Old 30/12/2010, 12:08 PM   #5
Macluawn
Gangsta
 
Macluawn's Avatar
 
Join Date: Aug 2010
Location: Latvia
Posts: 613
Reputation: 78
Default Re: Timers with playerid

oh right.. forgot about timerex
Macluawn is offline  
Old 30/12/2010, 12:10 PM   #6
juuleman
Gangsta
 
juuleman's Avatar
 
Join Date: Feb 2009
Location: The Netherlands
Posts: 507
Reputation: 0
Default Re: Timers with playerid

Quote:
Originally Posted by JamesC View Post
pawn Code:
SetTimerEx( "HouseTimer", 1000, false, "i", playerid );
One question, where does that "i" stand for?
__________________
juuleman is offline  
Old 30/12/2010, 12:11 PM   #7
_rAped
Huge Clucker
 
_rAped's Avatar
 
Join Date: Dec 2010
Posts: 394
Reputation: 2
Default Re: Timers with playerid

Quote:
Originally Posted by juuleman View Post
One question, where does that "i" stand for?
integr
_rAped is offline  
Old 30/12/2010, 12:11 PM   #8
Macluawn
Gangsta
 
Macluawn's Avatar
 
Join Date: Aug 2010
Location: Latvia
Posts: 613
Reputation: 78
Default Re: Timers with playerid

It stands for integer
Macluawn 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
Timers Antonio [G-RP] Help Archive 8 17/08/2011 03:35 PM
What's wrong with skins? GetPlayerSkin(playerid) & SetPlayerSkin(playerid, skin) McSquizzy Help Archive 7 16/04/2010 02:27 PM
Help with if(MedicBill[playerid] == 1 && PlayerInfo[playerid][pJailed] == 0 && Keeboo13 Help Archive 0 11/04/2010 05:38 AM
WG40[playerid] = 1; For everyone not only playerid? pawelf94 Help Archive 4 23/12/2009 03:31 PM


All times are GMT. The time now is 09:27 PM.


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