How to always move forward - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to always move forward (
/showthread.php?tid=423018)
How to always move forward -
Colossus874 - 16.03.2013
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?
Re: How to always move forward -
park4bmx - 16.03.2013
Use a walk animation!
Only way
Re: How to always move forward -
3ventic - 16.03.2013
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.
Re: How to always move forward -
park4bmx - 16.03.2013
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
Re: How to always move forward -
RajatPawar - 16.03.2013
By move, just SetPlayerPos or make him walk along to the point you want?
Re: How to always move forward -
Mystique - 16.03.2013
....