09.10.2014, 22:53
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 ...
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: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));
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);