Help with the timer.
#1

I want to script this shit when I /enter a building, the player will freeze for at least 3 seconds for the objects to load;
I tried with SetTimer, but the problem was that for me it freezed, and I got unfreezed after 3 seconds, but the other player that entered the building never got unfreezed. Could you tell me how to fix it?
Reply
#2

SetTimerEx
Reply
#3

Okay, I'm gonna try it.
Reply
#4

Look, help me out with those variables for SetTimerEx
Should they look like:
forward ptimer();

then
public ptimer()
{
TogglePlayerControllable(playerid, 1); [or wutever is it for unfreeze]
return 1;
}

Like that?
Reply
#5

Whats wrong with your Objects since you need to freeze?
what happends when they enter it without timer.
Reply
#6

Where are you getting the playerid value from in the function? It's never passed there, I assume you're trying to do something like this:

pawn Код:
SetTimerEx("ptimer", 1000, 0, "i", playerid);

public ptimer(playerid)
{
    TogglePlayerControllable(playerid, true);
    return 1;
}
Doesn't that make more sense? You're using SetTimerEx to the pass the value of playerid to the function, which then uses the value of playerid in the TogglePlayerControllable function.
Reply
#7

pawn Код:
new pTimerr;

pTimerr = SetTimerEx("ptimer", 1000, 0, "i", playerid);

public ptimer(playerid)
{
    TogglePlayerControllable(playerid, true);
    KillTimer(pTimerr);
    return 1;
}
Reply
#8

@Gertin, why would you kill nonexistant timer?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)