Timers: Need help
#1

Код:
public OnPlayerEnterCheckpoint(playerid)
{
    //-------------courier--------------
    {
    SetTimer("freeze", 3000, false);
	new freeze = TogglePlayerControllable(playerid, 0);
	freeze(playerid);
I need to know why this isn't working... and I was also wondering if you could describe or show me how to do this

Thanks, bigal
Reply
#2

If you want to freeze and unfreeze in 3 seconds, then

pawn Код:
public UnfreezePlayer(playerid)
{
    TogglePlayerControllable(playerid, 1);
}
pawn Код:
TogglePlayerControllable(playerid, 0);
SetTimerEx("UnfreezePlayer", 3000, false, "d", playerid);
Reply
#3

Keep everything in that callback except ' new freeze ' and the ' toggleplayercontrollable '

add this to the bottom of your script:

pawn Код:
forward freeze(playerid)
public freeze(playerid)
{
      TogglePlayerControllable(playerid, 0);
      return 1;
}
Try that
Reply
#4

Thanks Rep+
Reply
#5

pawn Код:
function FreezePlayer(playerid, time)
{
    new string[16];
    if(time > 0)
    {
        TogglePlayerControllable(playerid, false);
        SetTimerEx("FreezePlayer", 1000, 0, "ii", playerid, time-1);
    }

    else
    {
        TogglePlayerControllable(playerid, true);
    }
    return true;
}
Usage:
pawn Код:
FreezePlayer(playerid, Your_time);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)