SA-MP Forums Archive
Timers with playerid - 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: Timers with playerid (/showthread.php?tid=204736)



Timers with playerid - juuleman - 30.12.2010

Hey Guys,

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

pawn Код:
TogglePlayerControllable(playerid,false);//Preventing players falling true the objects at self made interiors.
SetTimer("HouseTimer",1000,false);
And somewhere else (the timer) this:

pawn Код:
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


Re: Timers with playerid - Macluawn - 30.12.2010

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.


Re: Timers with playerid - juuleman - 30.12.2010

Quote:
Originally Posted by Macluawn
Посмотреть сообщение
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!


Re: Timers with playerid - JamesC - 30.12.2010

pawn Код:
SetTimerEx( "HouseTimer", 1000, false, "i", playerid );



Re: Timers with playerid - Macluawn - 30.12.2010

oh right.. forgot about timerex


Re: Timers with playerid - juuleman - 30.12.2010

Quote:
Originally Posted by JamesC
Посмотреть сообщение
pawn Код:
SetTimerEx( "HouseTimer", 1000, false, "i", playerid );
One question, where does that "i" stand for?


Re: Timers with playerid - _rAped - 30.12.2010

Quote:
Originally Posted by juuleman
Посмотреть сообщение
One question, where does that "i" stand for?
integr


Re: Timers with playerid - Macluawn - 30.12.2010

It stands for integer