OnPlayerEnterVehicle
#1

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?
Reply
#2

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)