Need help with Player Private Vehicles
#1

I've made a /buyveh command, it shows the dialog with lists of cars and prices. It works. After the player buys the vehicle i've made it so it spawns near him with CreateVehicle. Now i don't know what to do from here, what i need is:

-How to save the players car, like it's his personal car and others can't enter.
-When he logs off, the car dissapears and when he logs in the car spawns.

Thank you in advance.
Reply
#2

Saving the vehicle isn't hard, Just save it's float x , y and z where the player parks the vehicle and about lock, You'll be needing OnVehicleStreamIn function check it out and loop through all players and check the variable that if the vehicle id is equal to his private vehicle and it's locked then setvehicleparams and lock it,

and for destroying, use DestroyVehicle(playervehiclevar); and when player spawns load his data on variables of x,y,z,color and other vars,
Then create it again !

Easy !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)