Force player to..
#6

use trigonometry

pawn Код:
new Float:Ox,Float:Oy,Float:Oz,//objects coords
      Float:Px,Float:Py,Float:Pz,Float:Pangle;

GetPlayerPos(playerid,Px,Py,Pz);

new Float:Hypotenuse=GetPlayerDistanceFromPoint(playerid,Ox,Oy,Oz);
new Float:Adjacent=floatadd(floatabs(Ox),(float(Px)*(-1)));

Pangle=acos(Adjacent/Hypotenuse)*(-1);

SetPlayerFacingAngle(playerid,Pangle);
SetPlayerControllable(playerid,1);
i didnt test the code but somehow atleast should give u an idea
Reply


Messages In This Thread
Force player to.. - by [rG]Cold - 25.10.2014, 20:31
Re: Force player to.. - by Steel_ - 25.10.2014, 20:33
Re: Force player to.. - by [rG]Cold - 25.10.2014, 20:35
Re: Force player to.. - by DerickClark - 25.10.2014, 20:37
Re: Force player to.. - by [rG]Cold - 25.10.2014, 20:41
Re: Force player to.. - by Quickie - 26.10.2014, 00:08
Re: Force player to.. - by Abagail - 26.10.2014, 00:39

Forum Jump:


Users browsing this thread: 1 Guest(s)