[Include] FreezePlayer(playerid, time)
#1

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

Too simple, even for new scripters.
Reply
#3

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

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

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

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, ...)
Reply
#7

Useful functions thread not good enough for you?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)