Posts: 597
Threads: 42
Joined: Jul 2012
Reputation:
0
Make a variable that hold the player vehicle id.
Posts: 929
Threads: 135
Joined: Sep 2009
Reputation:
0
It's already stored... SetVehiclePos( PlayerInfo[ playerid ][ p_VehID ], X, Y, Z );
I mean...sometime i don't get the right vehicle for the right player...
Posts: 11,827
Threads: 33
Joined: Dec 2011
Reputation:
0
Let's say you spawn a vehicle and its vehicle ID is 5. You store that value to the variable and the vehicle gets destroyed. Another player (B) spawns a vehicle and its vehicle ID is 5 and it's stored to the variable. You try to set the vehicle's position but it sets the position for the other player (B).
Solution: Reset the variable when a vehicle is destroyed to INVALID_VEHICLE_ID.
Posts: 3,133
Threads: 71
Joined: Dec 2013
Reputation:
0
[Deleted Post - Someone else already beat me to it]
Posts: 929
Threads: 135
Joined: Sep 2009
Reputation:
0
When i create the Personal Vehicle: PlayerInfo[ playerid ][ p_VehID ] = AddStaticVehicleEx( PlayerInfo[ playerid ][ CarID ],...etc. So when i use CarDeleter( PlayerInfo[ playerid ][ p_VehID ] ); i should make that var PlayerInfo[ playerid ][ p_VehID ] = INVALID_VEHICLE_ID ?
Posts: 1,801
Threads: 27
Joined: Mar 2009
Reputation:
0
Yes, you should. Do that for all vehicles stored in a variable.