24.06.2012, 09:15
I have a simpler solution. You can yourself lucky because I already scripted this function.
And for /fly:
Код:
stock SetPlayerForwardVelocity(playerid,Float:Velocity, Float:Z1) { new Float:Getx1, Float:Gety1, Float:Getz1; new Float:AngleZ1; new Float:SpeedX1, Float:SpeedY1; new Float:Mulx1, Float:Muly1; GetPlayerVelocity(playerid, Getx1 ,Gety1 ,Getz1); GetPlayerFacingAngle(playerid,AngleZ1); SpeedX1 = floatsin(-AngleZ1, degrees); SpeedY1 = floatcos(-AngleZ1, degrees); Mulx1 = floatmul(Velocity, SpeedX1); Muly1 = floatmul(Velocity, SpeedY1); SetPlayerVelocity(playerid, floatadd(Mulx1,Getx1), floatadd(Muly1, Gety1), floatadd(Getz1, Z1)); return 1; }
Код:
return SetPlayerForwardVelocity(playerid,0.6, 0.4);