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



Private vehicles - antonio112 - 22.11.2011

Hey everyone. Me again, with another question. The thing is I want to create a vehicle dealership. Alright, everything good so far. What's the problem ... Well, the thing is I have no idea how to save / load vehicles, that way so the IDs won't mix up. What I'm trying to say is that, I load (let's say) 300 vehicles. Alright, Y_Ini read 300 files and loaded all vehicles. Perfect. Now, here's the catch, when I'm trying to delete a vehicle. Let's say, I delete vehicle ID 200.

The ingame vehicle ID 200 (on /dl) will be deleted, works. The 200.ini file in scriptfiles gets deleted aswell, perfect.

Now, when I try to create a new vehicle, after I just delete one, my GM 'getsafreevehicleslot', it reaches 200.ini and boom, file 200 found free so the code continues. I create a vehicle in game (file 200.ini in scriptfiles) but ID 301 IN GAME, since 300 vehicles were already created. When I try to buy a new car, it all fucks up. My last created vehicle dissapears and stuff like that.

ON SHORT: how can I make a private vehicle system, without mixing %i.ini's with ingame ID's ?

Thanks.


Re: Private vehicles - PRototype-RP - 23.11.2011

(Car)
[player ID]
(Car ID)
(Color1_Color2)
{Owner_Partofname}