open.mp forum
[Pawn] Help! How to make a Marine Submarine System Moveable in the Sea with w a s d control? - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10)
--- Thread: [Pawn] Help! How to make a Marine Submarine System Moveable in the Sea with w a s d control? (/showthread.php?tid=1949)



Help! How to make a Marine Submarine System Moveable in the Sea with w a s d control? - PutuSuhartawan - 2021-04-25

I first created a ship and made the dynamic object move. But I have a question, how can ships or objects be controlled again using the keyboard? like driving a vehicle in general?


RE: Help! How to make a Marine Submarine System Moveable in the Sea with w a s d control? - Awide - 2021-04-26

You can't really make it like driving a vehicle in general, but you can detect buttons being pressed and change the object's position based on that.


RE: Help! How to make a Marine Submarine System Moveable in the Sea with w a s d control? - Snow - 2021-04-27

(2021-04-26, 10:48 AM)Awide Wrote: You can't really make it like driving a vehicle in general, but you can detect buttons being pressed and change the object's position based on that.

Yes you can. Simply create a RC Cam or any small vehicle and then use AttachObjectToVehicle. Attach that ship or whatever object you want to drive to the vehicle and use putplayerinvehicle.
But it won't be fully functional because you cannot come out of RC vehicles using enter/F key. So you have to figure out a way for that.