DestroyCar alternatives?
#1

Hello!

I am doing a Vehicle System using MySQL. Everything goes fine but now, I have a little problem. When I store my car I use DestroyVehicle() function. When I respawn it the ID of the car changes because I don't have only one car. Is any possibilities to keep the ID on the server? Because I have an ID of MySQL from where I select the car to spawn, and it spawns ok (model, owner, colors, etc.) but if the Id in-game changes, then another commands like /respawncar [id] will not work propertly because they are calling the new car located at this id.

Anyone knows how can I "hide" the car keeping the ID? Or a good vehicle fs script based on MySQL? I've searched but all the scripts are so buggy.

Lot of thanks!
Reply
#2

Vehicleids are never to be stored in the database because they are volatile. The id in the database is merely there to uniquely identify the row; it's not the same as the in-game vehicleid nor is it supposed to have any other intrinsic value. You must store the id of the row inside a variable upon a vehicle's creation so you can cross-reference the in-game vehicleid with the rowid later.
Reply
#3

That's what I have. I have an auto_increment row and then, a carid row, this carid row it's equal to the id auto_increment row. I fetch the data using VehicleSystem[i][carid] (where i, is a for loop, for example). But what happens when the ID in samp change? How I can do it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)