how to freeze a player? - 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: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: how to freeze a player? (
/showthread.php?tid=293664)
how to freeze a player? -
niels44 - 29.10.2011
hey everyone i am using streamer plugin but now when i teleport to somewhere like /drag the objects load little bit slowlier then the player so u fall down in the water but now i thought i can freeze the polayer for 1 or 2 seconds but how to make it in a command? i searched in pawno but could find a code for it so pls help me for the version 1.2 of my drifting gamemode
Re: how to freeze a player? -
[MG]Dimi - 29.10.2011
TogglePlayerControllable
Re: how to freeze a player? -
niels44 - 29.10.2011
but how to put a timer on it for like 1 or 2 seconds?
Re: how to freeze a player? -
LZLo - 29.10.2011
here is it
PHP код:
forward Unfreeze(playerid);
CMD:drag(playerid, params[]) {
TogglePlayerControllable(playerid, 0);
SetTimerEx("Unfreeze", 2000, 0, "d", playerid);
return 1;
}
public Unfreeze(playerid) {
TogglePlayerControllable(playerid, 1);
return 1;
}
Re: how to freeze a player? -
0x80808000 - 29.10.2011
Or:
pawn Код:
stock SetPlayerPosEx(playerid, Float:x, Float:y, Float:z, UNFREEZE_DELAY){
SetTimerEx("Unfreeze", UNFREEZE_DELAY, false, "i", playerid);
TogglePlayerControllable(playerid, false);
return SetPlayerPos(playerid, x, y, z);
}
forward Unfreeze(thePlayer);
public Unfreeze(thePlayer){
TogglePlayerControllable(playerid, true);
return true;
}
Re: how to freeze a player? -
niels44 - 30.10.2011
eehm.... where to place all this? XD
Re: how to freeze a player? -
Michael@Belgium - 30.10.2011
Quote:
Originally Posted by niels44
eehm.... where to place all this? XD
|
lol this is simple: ofcourse SetPlayerControllable ...
pawn Код:
SetPlayerControllable(playerid,0);
Re: how to freeze a player? -
Edvin - 30.10.2011
ShoObjects xD
http://solidfiles.com/d/283b/
Re: how to freeze a player? -
nitrochegs - 30.10.2011
Quote:
Originally Posted by niels44
eehm.... where to place all this? XD
|
Simple, for the first solution which was posted by LzLo, put the forward in the top portion of your script. And of course the command itself doesn't go under any callback, so itself is alone. Then the public unfreeze callback is yet another callback, so add it to the bottom of your script. So basically you won't be adding anything under any callback for this.
Don't forget to +rep people who helped u