How to always move forward
#1

Hello, so I would like to press /enter and whatever the angle or position is, it would move the player straight forward the set distance. Can anyone help me?
Reply
#2

Use a walk animation!
Only way
Reply
#3

pawn Код:
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
SetPlayerPos(playerid, x-(DISTANCE_TO_MOVE*floatsin(a, degrees)), y+(DISTANCE_TO_MOVE*floatcos(a, degrees)), z);
Tested it and it works, replace DISTANCE_TO_MOVE with the distance you want to move the player.
Reply
#4

Quote:
Originally Posted by 3ventic
Посмотреть сообщение
pawn Код:
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
SetPlayerPos(playerid, x-(DISTANCE_TO_MOVE*floatsin(a, degrees)), y+(DISTANCE_TO_MOVE*floatcos(a, degrees)), z);
Tested it and it works, replace DISTANCE_TO_MOVE with the distance you want to move the player.
Most lagy way possible, also It will not even look good
Reply
#5

By move, just SetPlayerPos or make him walk along to the point you want?
Reply
#6

....
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)