Vehicle Ownership Help. - 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: Vehicle Ownership Help. (
/showthread.php?tid=369582)
Vehicle Ownership Help. -
TaLhA XIV - 17.08.2012
Hello,
Today I started to make a vehicle owner ship system.Okay now I have a question that how can I assign a car player's name.Like if a player buys a vehicle,then it belongs to him only.Like if a another player tries to enter that vehicle,and tries to start the engine he can not because he do not have the keys of the vehicle.((no script needed just a small piece of code or just some simple explanation.))
ThAnKs!
Re: Vehicle Ownership Help. -
aintaro - 17.08.2012
What I did for mine was run everything off of vehicle IDs.
If you have already got a way of saving player stats then you can easily implement from there. Then once you've set that up, you could head down to your /start command and do an 'if' something like this:
Код:
new vid = GetPlayerVehicleID(playerid);
if(PlayerInfo[playerid][pVeh1] == vid)
{
SendClientMessage(playerid, 0x33AA33AA, "* Your vehicle has started!");
//Rest of your code here
}
else SendClientMessage(playerid, 0xFFFF00AA, "* You do not own this vehicle!");
Let me know if you need a further explanation.
Re: Vehicle Ownership Help. -
TaLhA XIV - 17.08.2012
Can you explain these enums please and thanks.
Re: Vehicle Ownership Help. -
TaLhA XIV - 17.08.2012
Please explain.
Re: Vehicle Ownership Help. -
TaLhA XIV - 17.08.2012
Sorry but I got it.Thxkkkks!