Closed LDami closed 3 months ago
Is it called when leaving brown streak (model ID 538) as passenger, or when leaving the brown streak carriage (model ID 570)?
If not then I guess that this is normal behaviour, as (as passenger) players don't leave these vehicles in the usual manner - basically the player position is set to next to the vehicle.
Yes it is the same with brown streak. Is it possible to detect when a player leave trams or trains ?
Simply use OnPlayerStateChange and store the players vehicle ID when they enter a vehicle, then (again with OnPlayerStateChange) you can check if oldstate is PLAYER_STATE_PASSENGER and if their previous vehicle was train/tram.
In case if samp server behaviour is different, I think it possibly may be because of validation checks. If open.mp server now checks vehicleid if it's streamed in for player inside EnterVehicle and ExitVehicle events, there may be an issue with trains as they are not considered "streamed in" like other cars. That's just my assumption as I didn't check the current validations in the source files yet.
Simply use OnPlayerStateChange and store the players vehicle ID when they enter a vehicle, then (again with OnPlayerStateChange) you can check if oldstate is PLAYER_STATE_PASSENGER and if their previous vehicle was train/tram.
Seen it done with KEY_SECONDARY_ATTACK
check in OnPlayerKeyStateChange
also.
Simply use OnPlayerStateChange and store the players vehicle ID when they enter a vehicle, then (again with OnPlayerStateChange) you can check if oldstate is PLAYER_STATE_PASSENGER and if their previous vehicle was train/tram.
Seen it done with
KEY_SECONDARY_ATTACK
check inOnPlayerKeyStateChange
also.
If the train/tram is moving at a certain speed you can't always exit it no matter how much you spam the key.
Does this work in samp?
It's the same behaviour in SA-MP.
Just tested it too, samp server doesn't call it as well (so it's not called from the client itself).
Then it's a client issue, closing this
Describe the bug The callback OnPlayerExitVehicle is not called when the player leave the Tramway. OnPlayerEnterVehicle is correctly called.
To Reproduce Steps to reproduce the behavior:
Expected behavior The callback OnPlayerExitVehicle must be called (the message "You left the tram !" must be displayed).
Release version 1.2.0.2670