I am relatively new to FiveM modding. I was checking through http://www.dev-c.com/nativedb/ns/PLAYER to see which function calls are possible. There I have spotted functions like:
Vehicle GET_PLAYERS_LAST_VEHICLE() // B6997A7EB3F5C8C0 E2757AC1
Surely, vehicle must be able to have some null value (probably 0?) just in case the player never entered a vehicle. How do I then for this? I guess:
if vehicle then --... end
- Is this assumption correct?
- If so, does this assumption also include PEDs? If not, does the correct way also include PEDs?
- How do I check if a vehicle, that might once have been valid, is still present in the game world?
- If I get a correct vehicle returned, which is then destroyed, can I still refer to this vehicle via the previous vehicle value?
Thanks in advance!