SA-MP Forums Archive
TogglePlayerControllable - 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: TogglePlayerControllable (/showthread.php?tid=247532)



TogglePlayerControllable - fissekarl - 09.04.2011

Anyone got a code where it freezes a player, but they can still move the camera? And they cant shoot either?


Re: TogglePlayerControllable - tanush - 09.04.2011

umm thats impossible to do that


Re: TogglePlayerControllable - Sascha - 09.04.2011

hm not really impossible... but I don't know whether something like this exists...
there would be ways to make it however I don't have time to try it out now -.-
maybe I'm trying it out tomorrow...


Re: TogglePlayerControllable - Mean - 09.04.2011

Put him into an invisible object, he won't be able to move, but he will move his camera.


Re: TogglePlayerControllable - fissekarl - 09.04.2011

Can you show code please?


Re: TogglePlayerControllable - linuxthefish - 09.04.2011

Have a timer that sets his position every 5 milliseconds if he try's to move


Re: TogglePlayerControllable - Admigo - 10.04.2011

I think it impossible. Why you need this?


Re: TogglePlayerControllable - Miguel - 10.04.2011

There are some animations that won't let the player move, I've never tried them, though.


AW: TogglePlayerControllable - sworter - 10.04.2011

It's a dirty way but should work! -> Untested <-
sry for my bad english

Код:
new Float:TempPoses[MAX_PLAYERS][4]; //Tempory Save to Set Positions and get info when a player is freezed 

OnPlayerUpdate(playerid)
{
        if(TempPoses[playerid][3]==1.0)
                SetPlayerPos(playerid,TempPoses[playerid][0],TempPoses[playerid][1],TempPoses[playerid][2]);
        return 1;
}

stock FreezeNoCam(playerid,freeze=1)  //If freeze is = 1 the player get freezed, if 0 he get unfreezed
{
        GetPlayerPos(playerid,TempPoses[playerid][0],TempPoses[playerid][1],TempPoses[playerid][2]);
        TempPoses[playerid][3]=float(freeze);
	return 1;
}
Use FreezeNoCam(playerid); to freeze a player
Use FreezeNoCam(playerid,0); to unfreeze him


AW: TogglePlayerControllable - sworter - 10.04.2011

tested now. Worked fine for me! ^^