How to know what player the camera is facing?
#5

Very well explained, I already knew most of what you explained, I used a similar method with sin and cos in my script in which players can throw players ...

pawn Код:
new Float:X, Float:Y, Float:Z, Float:VX, Float:VY, Float:A;
                GetPlayerCameraFrontVector(playerid, VX, VY, A);
                A = atan2(VY, VX) + 270.0;
                GetPlayerVelocity(targetid, X, Y, Z);
                SetPlayerVelocity(targetid, floatsin(-A, degrees) * 0.5, floatcos(A, degrees) * 0.5 , floatabs((Z*2.5)+1.035));
To the player/vehicle positions being inverted, I also use the method for spawning cars in front of my admins facing the left side of them, and yes, you do add 90 :P...

pawn Код:
new Float:x,Float:y,Float:z,Float:r;
                GetPlayerPos(playerid, x, y, z);
                GetPlayerFacingAngle(playerid,r);
                x += (5 * floatsin(-r, degrees));
                y += (5 * floatcos(-r, degrees));

                CreateVehicle(vehicleid, x, y, z, [COLOR="Red"]r+90[/COLOR], color1, color2, 5000);
Reply


Messages In This Thread
How to know what player the camera is facing? - by Crayder - 08.10.2014, 21:12
Re: How to know what player the camera is facing? - by Rudy_ - 09.10.2014, 08:37
Re: How to know what player the camera is facing? - by Crayder - 09.10.2014, 11:28
Re: How to know what player the camera is facing? - by Rudy_ - 09.10.2014, 12:06
Re: How to know what player the camera is facing? - by Crayder - 09.10.2014, 22:53

Forum Jump:


Users browsing this thread: 2 Guest(s)