25.09.2010, 15:25
I must know how to make SetPlayerVelocity work on player facing angle, so if he uses /megajump, he jumps few meters in his facing direction.
new Float:vx, Float:vy, Float:vz;
new Float:rot;
GetPlayerFacingAngle(playerid, rot);
rot = 360 - rot; //Dont know how to evade this line, and too lazy to test it out ;)
GetPlayerVelocity(playerid, vx, vy, vz);
SetPlayerVelocity(playerid, vx + jumpspeed * floatsin(rot, degrees), vy + jumpspeed * floatcos(rot, degrees), vz + zjumpspeed);
stock MegaJump(playerid, Float:forwardspeed, Float:upwardspeed)
{
new Float:vx, Float:vy, Float:vz;
new Float:rot;
GetPlayerFacingAngle(playerid, rot);
rot = 360 - rot;
GetPlayerVelocity(playerid, vx, vy, vz);
SetPlayerVelocity(playerid, vx + forwardspeed * floatsin(rot, degrees), vy + forwardspeed * floatcos(rot, degrees), vz + upwardspeed);
return 1;
}