Posts: 1,290
Threads: 69
Joined: Dec 2006
Reputation:
0
If the vehicle is locked it isn't called if you are entering as driver. I spoke to ****** and he said that the bug is that it IS called when you enter as passenger?
Posts: 1,180
Threads: 55
Joined: Apr 2005
Reputation:
0
That very well might be a bug, but you shouldn't really use that callback often because it's not deterministic. The player can cancel the vehicle entry and also the client logic might reject entry (eg if it's locked).
The correct way is to use the OnPlayerStateChange callback, newstate PLAYER_STATE_DRIVER with GetPlayerVehicleId();
Examples of their use are found in rivershell.pwn
#define PLAYER_STATE_EXIT_VEHICLE (4) // (used internally)
#define PLAYER_STATE_ENTER_VEHICLE_DRIVER (5) // (used internally)
#define PLAYER_STATE_ENTER_VEHICLE_PASSENGER (6) // (used internally)
You can also make use of these state changes for what you requested.