Posts: 201
Threads: 43
Joined: Apr 2011
Reputation:
0
Alright so i want to make a rental system but the cars will be spawned from dialog text for example a list dialog when they click the car that they want to rent it will spawn, But i want each car that is spawned to have an id so that i can make sure only the person that has rented that car can use it how would i go about doing something like this?
Posts: 6,129
Threads: 36
Joined: Jan 2009
Each time you spawn a car, it has a unique identifying number. It changes when the vehicle is destroyed though, is this what you're looking for?
Posts: 201
Threads: 43
Joined: Apr 2011
Reputation:
0
yes how do i get this number though im unsure how i would make the rental car only be usable by them.
Posts: 6,129
Threads: 36
Joined: Jan 2009
You can use GetPlayerVehicleID() to determine which vehicle the playerid is in.
Posts: 2,856
Threads: 6
Joined: Jun 2007
Reputation:
0
If you create the vehicle the return value of CreateVehicle is the unique vehicleid
Posts: 201
Threads: 43
Joined: Apr 2011
Reputation:
0
could you give a code example of how i could set that?
Posts: 201
Threads: 43
Joined: Apr 2011
Reputation:
0
i mean how can i get that id and give it to the player?
Posts: 3,004
Threads: 12
Joined: May 2011
lol
i think i got what did you say
here you can see vehicle's ids+names :
https://sampwiki.blast.hk/wiki/Vehicle_Model_ID_List
CODE:
pawn Код:
CreateVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay);
CreateVehicle(411, 0.000, 0.000, 10.1234,50,120,120,5);
//Explaning : CreateVehicle(Vehicle id(for example :: 411) ,X(look on the Picture),Y(look on the Picture),Z Hight(+Z = UP | -Z = Down) , FacingAngle(Look on the picture(with this you can rotate the vehicle), color1(vehicle Colour) ,color2(vehicle colour),Respawn time(how much time he will stay in the same place with out a driver)
Picture:
FacingAngle(the vehicle in the center) :
i hope it will help you alittle
Scripters : fix me if i sayed somthing wrong >.<