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



Problem with vehicles - buburuzu19 - 01.09.2015

I have a really really big problem with my vehicles.
I create vehicles like this lspdcar[0] = CreateVehicle(...); but my next problem is that personal cars are spawning with ids like: first cars 367 , 368 ( which is good because it continues from last vehicle created in gm) and then 26,27 .. and this ids are already created by normal cars.
It's something like this:
I have 303 cars created on server, if i create a new one by command the new one goes to id 3 or 4, not 304.
How to fix this problem ?


Re: [REP ++ WHO HELPS] Problem with vehicles - Roberto80 - 01.09.2015

I think id 3/4 is empty car slot,so it use it,anyway try to do something like:
public OnVehicleSpawn(vehicleid)
{
VehCount++;
}
Understand the idea?


Re: [REP ++ WHO HELPS] Problem with vehicles - buburuzu19 - 01.09.2015

Quote:
Originally Posted by Roberto80
Посмотреть сообщение
I think id 3/4 is empty car slot,so it use it,anyway try to do something like:
public OnVehicleSpawn(vehicleid)
{
VehCount++;
}
Understand the idea?
Id 3/4 it's not a slot. It's a created car under ongamemode init , thanks for your response but it isn't enough.
Anyone else?


Re: Problem with vehicles - buburuzu19 - 02.09.2015

UP!!!


Re: Problem with vehicles - bgedition - 02.09.2015

You cannot write into running gamemode with a command. You need to make a system to save spawned cars to load them and so on.. You should use MySQL or Y-INI to save the vehicle's I'd and info or you can just download one from the web.

Michael


Re: Problem with vehicles - buburuzu19 - 02.09.2015

FIXED.