SA-MP Forums Archive
Freezing a player on /enter. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Freezing a player on /enter. (/showthread.php?tid=254084)



Freezing a player on /enter. - GangsTa_ - 09.05.2011

I have the object streamer, but the objects won't load so fast with it. I want when I write /enter it would freeze me for like 4 seconds for the objects to load.
I've tried one time, but for me it worked, but for the other player entering he freezed, but didn't even get unfreezed.
Please help, here's my /enter code:

pawn Код:
else if (PlayerToPoint(2.0, playerid, 1173.2563,-1323.3102,15.3943)) // hospital
{
    SetPlayerPos(playerid, 1189.6974,-1337.5695,1384.0446);
}



Re: Freezing a player on /enter. - Calgon - 09.05.2011

You can use this.


Re: Freezing a player on /enter. - GangsTa_ - 09.05.2011

Holy shit okay. Even less work lol.


Re: Freezing a player on /enter. - Calgon - 09.05.2011

Yeah, I agree the include is poorly scripted, maybe I can actually just help you.

What you'll need to do is temporarily freeze the player then unfreeze them with a timer - in your code I see nothing of that nature yet.

So here's what you should do:

Add this to your /enter code:
pawn Код:
TogglePlayerControllable(playerid, false);
// You can't use forwarded natives in SetTimer(Ex), so we'll have to create a public to wrap the function
SetTimerEx("_TogglePlayerControllable", 3000, false, "d", playerid);
Add this outside of any other code:
pawn Код:
public _TogglePlayerControllable(playerid, control) {
   TogglePlayerControllable(playerid, control);
   return 1;
}
You might want to add some kind of gametext though.


Re: Freezing a player on /enter. - GangsTa_ - 09.05.2011

I got it, I'll test first if the 'Load' include works.