[Help] UnfreezeTimer
#1

Hello.. I was making unfreeze timer when people enter building and after timer ends.. server unfreeze him.

pawn Код:
forward UnfreezeTimer( playerid );

public UnfreezeTimer( playerid )
{
    TogglePlayerControllable(playerid, true);
    return 1;
}
// this goes under OnPlayerKeyStateChange
if(IsPlayerInRangeOfPoint( playerid, 2, 1772.0117, -1548.0527, 9.9070) )
            {
                SetPlayerPos( playerid, 2534.3948, -1366.6055, 1041.4506);
                SetPlayerInterior( playerid, 2);
                TogglePlayerControllable(playerid, false);
                SetTimer("UnfreezeTimer", 3000, false);
            }
If one player enter and 2nd enter after him.. server unfreezes player who entered 2nd and 1st is frozen perm.
Whats wrong?
Reply
#2

Up...
Is there anyone who can really help?
Reply
#3

You have to pass the player's ID by reference, see this: https://sampwiki.blast.hk/wiki/SetTimerEx

And don't forget to kill the timer when it's done what it's supposed to do!
Reply
#4

Use:
Код:
SetTimerEx("UnfreezeTimer", 3000, false, "d", playerid);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)