SA-MP Forums Archive
[Include] FreezePlayer(playerid, time) - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] FreezePlayer(playerid, time) (/showthread.php?tid=293755)



FreezePlayer(playerid, time) - Kayaque - 29.10.2011

How to use
- Simply use FreezePlayer(playerid, seconds);
- After the given seconds the player will be unfreezed.

Areas of use
- Custom interiors
- Admin freezing of players

Comment from scripter
- Nothing special, but useful for those who's new to scripting.
- You can simply see how I put together this function below.

pawn Код:
forward Unfreeze(playerid);
public Unfreeze(playerid)
{
    TogglePlayerControllable(playerid, 1);
    return 1;
}
stock FreezePlayer(playerid, time)
{
    SetTimerEx("Unfreeze", time*1000, false, "u", playerid);
    TogglePlayerControllable(playerid, 0);
    return 1;
}



Re: FreezePlayer(playerid, time) - Jochemd - 29.10.2011

Too simple, even for new scripters.


Re: FreezePlayer(playerid, time) - Gamer_Z - 29.10.2011

Quote:
Originally Posted by Kayaque
Посмотреть сообщение
How to use
- Simply use FreezePlayer(playerid, seconds);
- After the given seconds the player will be unfreezed.

Areas of use
- Custom interiors
- Admin freezing of players

Comment from scripter
- Nothing special, but useful for those who's new to scripting.
- You can simply see how I put together this tutorial below.

pawn Код:
forward Unfreeze(playerid);
public Unfreeze(playerid)
{
    TogglePlayerControllable(playerid, 1);
    return 1;
}
stock FreezePlayer(playerid, time)
{
    SetTimerEx("Unfreeze", time*1000, false, "u", playerid);
    TogglePlayerControllable(playerid, 0);
    return 1;
}
did you actually test it? as long as I remember I don't see a "u" placeholder in any sa-mp natives...
https://sampwiki.blast.hk/wiki/SetTimerEx
https://sampwiki.blast.hk/wiki/Format
...


Re: FreezePlayer(playerid, time) - Jochemd - 29.10.2011

Quote:
Originally Posted by Gamer_Z
Посмотреть сообщение
did you actually test it? as long as I remember I don't see a "u" placeholder in any sa-mp natives...
https://sampwiki.blast.hk/wiki/SetTimerEx
https://sampwiki.blast.hk/wiki/Format
...
Yep, it's either "i" or "d" in SetTimerEx - this isn't sscanf.


Re: FreezePlayer(playerid, time) - Kayaque - 29.10.2011

Yes, this function is simple, but useful as I stated.
Constructive critisism is welcome, pure trolling to raise postcount is not, so spare it.

"u" works fine in timers, test it out before you comment that it doesnt.


Re: FreezePlayer(playerid, time) - Gamer_Z - 29.10.2011

lol it works WTF O_o

What The Fuck did kalcynka do with settimerex that's not on the sa-mp wiki...? ; o
lol it works with all other characters too (except the ones used for ex hex, bin, string, ...)


Re: FreezePlayer(playerid, time) - Norn - 30.10.2011

Useful functions thread not good enough for you?