Whats the id of the first created vehicle?
#1

Whats the id of the first created vehicle on the server? Is that 0 or 1? I guess its 1 because 0 - is an invalid vehicleid.
Reply
#2

It's 1.
Reply
#3

That was i expected. Hm. OK. I have some weird problem with saving the first created vehicle...
Reply
#4

Vehicles, Pickups, Text Draws, 3D Text Labels, Objects...
I'm not sure which start at 0 or 1, so what I do is after creating them, bump the Int Varible up by +1, then bump it down -1 whenever I might need to access that information. This helps me determine if a certain varible actually exist also since default of any checked varible is always 0 etc.

Not sure exactly if this would help with your problem or not, but thought it was still worth mentioning

Example though: A vehicle is created which returns its vehicleid, so I add +1 to that (Varible) right after its been created. In most cases, you might need to check if that varible matches up to a certain vehicle id, so I first do a check if the varible is not 0, then -1 to that varible & perform the check. Restoring the +1 after all those actions if nessecary (Not Destroyed or something).
Reply
#5

Im trying to use native SA-MP features but yeah, sometimes they are too fucked up for proper work... I dunno how, but when im buying vehicles at dealership - everything works allright, the id, the owner, the slot (0,1,2), everything marked nicely. But when im saving em at disconnect, the first slot vehicle is not saving and vehicle 1 saves to slot 0 also vehicle 2 saves to slot 1... Some stupid mismatch.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)