SA-MP Forums Archive
Unused vehicles - 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: Unused vehicles (/showthread.php?tid=318928)



Unused vehicles - KviZ - 17.02.2012

How do I make it so that unused vehicles can't be moved?

P.S. I'm really new to pawn, explanation would be great.


Re: Unused vehicles - Vince - 17.02.2012

Save the vehicle position in a variable when a player exits it (note: falling of a bike does not count as exit!). Then use OnUnoccupiedVehicleUpdate to restore the pos everyone once in a while. Bear in mind that this callback functions like OnPlayerUpdate: it is called very frequently, so don't put a whole load of code in it.