Timers with playerid
#1

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
Reply
#2

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.
Reply
#3

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!
Reply
#4

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

oh right.. forgot about timerex
Reply
#6

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

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

It stands for integer
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)