How works vehicle ownership. - 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: How works vehicle ownership. (
/showthread.php?tid=420920)
How works vehicle ownership. -
edzis84 - 07.03.2013
Hey all.
I want to make vehicle ownership but i have no idea how its built up.
I had idea that when player types like /v get 1 It creates car and loads all tunings and stats from ini file.
Then /v park and it just deletes car and next time player spawns it, it just loads all stats from file and makes new one.
Is it right?
Re : How works vehicle ownership. -
Shidony - 07.03.2013
Yes that's it, you just need to tell the script that car ID 13 for example belongs to John_Marks for example.
AW: How works vehicle ownership. -
edzis84 - 07.03.2013
Thanks, maybe you can post some simple example how to set it?
If you know.
Re: How works vehicle ownership. -
Denying - 07.03.2013
I would just save the vehicle id at the player's file.
Re: How works vehicle ownership. -
shady001 - 07.03.2013
The usual way is , create a PlayerData variable named for example CarKey.
If it buys a vehicle the CarKey = Vehicle id.
And to know if it is his car when it is typing a comand do : if(PlayerData[playerid][CarKey] == GetVehicleID(playerid)
Once you have server up and running make sure you don't put another car before the load of personal vehicles because it will mess up the ids and people will have another car key...
EDIT: and make something like PersonalCars() , to specify from id X to id Y is a personal vehicle and it can be bought ...