-
Notifications
You must be signed in to change notification settings - Fork 980
Add baseevents fallback for vehicle event triggers #1205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add baseevents fallback for vehicle event triggers #1205
Conversation
Implements client-side detection and server event triggers for entering, aborting, entering, and leaving vehicles when the 'baseevents' resource is not started. This ensures vehicle-related events are still handled even if the baseevents resource is unavailable.
Cisternita
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not useful
Why not? Why make a full event of QBCore relly on the existance of a script or not in the server and don't have a fallback? |
|
I haven't tested this event personally, but could we benefit from using the CEventNetworkPlayerEnteredVehicle game event instead of the thread? |
|
I don't think that event will detect the seat change |
|
Do you mean when someone shuffles seat without leaving the vehicle? |
|
exactly |
|
And also when entering is aborted |
|
From what I see, the current logic is: |
True, Do you know if that event triggers every time someone tries to get into vehicle? I mean, is it like the shooting one that triggers once for each ped near the shooting or is it only one by the player trying to get into a vehicl |
|
I dont really think we should be forcing our users to use baseevents, which this is pretty much doing. It isnt performant at all, and it is very well possible that servers choose intentionally not to use baseevents - which this would circumvent. |
|
I agree we shouldn't force users to use The way I see it is people should instead be using To me, that just leaves the main question of:
Also, was my first comment ever looked into further for entering vehicles? If not I can try to fit some time in to look at it: CEventNetworkPlayerEnteredVehicle If we can't find something more event based for everything, I believe our best course of action is:
|
|
I'll look into this |
Description
This pull request adds a fallback implementation for vehicle-related player events in
server/events.luato ensure core vehicle event handling works even if thebaseeventsresource is not running. The new code tracks when a player enters, aborts entering, enters, or leaves a vehicle, and triggers the appropriate server events.Baseevents fallback implementation:
baseevents:enteringVehicle,baseevents:enteringAborted,baseevents:enteredVehicle,baseevents:leftVehicle) when thebaseeventsresource is not started. This ensures consistent vehicle event handling regardless of resource state.GetPedVehicleSeatto determine the seat index the player occupies in a vehicle.Checklist