13.09.2009, 11:39
I wanna make a function to check if the vehicle id exists on my server.
if i spawn 10 cars. the ids are 1-10. so vehid = 10.
if I delete vehicles 3, 4 and 5. I can still do /delcar 5 and re-delete vehicleid 5, even though it doesnt exist anymore.
No actual vehicle is deleted if i re-delete a vehicle id, but the vehid lowers by 1.
So what im trying to make is and function to check if the vehicleID has been deleted or if it exists.
Is there a good way to do that, or would i be better shifting the vehicleids by 1 each time one is deleted... so if i have 10 vehicles vehid = 10.
if i delete vehicleid 5. vehicleID 6 would then become vehicleid 5., 7 to 6... 8 to 7... 9 to 8.... 10 to 9... so then vehid = 9
if i spawn 10 cars. the ids are 1-10. so vehid = 10.
if I delete vehicles 3, 4 and 5. I can still do /delcar 5 and re-delete vehicleid 5, even though it doesnt exist anymore.
No actual vehicle is deleted if i re-delete a vehicle id, but the vehid lowers by 1.
So what im trying to make is and function to check if the vehicleID has been deleted or if it exists.
Is there a good way to do that, or would i be better shifting the vehicleids by 1 each time one is deleted... so if i have 10 vehicles vehid = 10.
if i delete vehicleid 5. vehicleID 6 would then become vehicleid 5., 7 to 6... 8 to 7... 9 to 8.... 10 to 9... so then vehid = 9