SA-MP Forums Archive
Drive vehicle on its own - 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: Drive vehicle on its own (/showthread.php?tid=652566)



Drive vehicle on its own - MeW - 14.04.2018

Hi,

is it possible to simulate a keypress like for example 'W'? I wanted to programm a system, that when you type /autodrive or something like that, your vehicle drives on its on and you have your hands free to communicate in IC.

Basically a similiar system to /walk but just for vehicles.


Regards


Re: Drive vehicle on its own - Milak - 14.04.2018

I have idea to change vehicle's velocity, why not try.


Re: Drive vehicle on its own - Mugala - 14.04.2018

yeah, you have to get player's vehicle velocity and keep this velocity for a time.

PHP код:
GetVehicleVelocity(vehid,X,Y,Z); // to get vehicle's velocity
SetVehicleVelocity(vehid,X,Y,Z); // to set velocity (it must be same to keep vehicle's current speed)