SA-MP Forums Archive
Moving An Object - 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: Moving An Object (/showthread.php?tid=458860)



Moving An Object - arjanforgames - 18.08.2013

How can I move an object forward with ^ and sidewards with < >? ((<> represent arrow keys))
Is it possible to "drive" and object?


Re: Moving An Object - Vanter - 18.08.2013

Search forums, look at drivable objects in filterscripts, learn.


Re: Moving An Object - sleepysnowflake - 18.08.2013

yes you can "drive" an object

you need this
pawn Код:
stock GetXYInFrontOfPoint(Float:x, Float:y, &Float:x2, &Float:y2, Float:A, Float:distance)
{
    x2 = x + (distance * floatsin(-A, degrees));
    y2 = y + (distance * floatcos(-A, degrees));
}
forwards would be the coords in front of the player; backwards would be 180 rotated; > would be 90 and < would be 270;

for that tho you need to know some trigonometry and i'm not good at it.

you can however use this