-
-
Notifications
You must be signed in to change notification settings - Fork 496
Add onElementWaterInteract event #1657
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
Conversation
I think that this event need to be complex. I see this like a onElementWaterInteract what will works with peds, vehicles and objects (maybe) and has bWaterInOrOut parameter.
for objects not worth it.
We'll need to get a proper event name
@qaisjp any ideas?
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.
This is a convention in the code more or less, afaik.
But I'd use {} there, or CLuaArguments() (but {} should work)
Not even sure why CallEvent doesn't default construct CLuaArguments
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.
Same here
Co-authored-by: Nikita Obrekht <obrekht@gmail.com>
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.
I think that this event need to be complex. I see this like a
onElementWaterInteractwhat will works with peds, vehicles and objects (maybe) and hasbWaterInOrOutparameter.
I agree with @TheNormalnij's comment (copied above, from here: #1657 (comment))
This onVehicleDrown event doesn't look like it's detecting when a vehicle drowns, but when it interacts with water. Changing the event name now would make this a matter of finding a reason to merge code that accidentally doesn't work as intended.
Please create an issue proposing what feature you want to implement. In that issue, once we've discussed the what the feature should look like, we can discuss whether the code here is appropriate for that. In your issue, please try and provide answers to the questions written here. (Yes, it's a link to Windows Calculator's repo. See #887 for more context on what a "proposal" means.)
Co-authored-by: saml1er <10183157+saml1er@users.noreply.github.com>
Co-authored-by: saml1er <10183157+saml1er@users.noreply.github.com>
Co-authored-by: saml1er <10183157+saml1er@users.noreply.github.com>
I think that this event need to be complex. I see this like a
onElementWaterInteractwhat will works with peds, vehicles and objects (maybe) and hasbWaterInOrOutparameter.I agree with @TheNormalnij's comment (copied above, from here: #1657 (comment))
This
onVehicleDrownevent doesn't look like it's detecting when a vehicle drowns, but when it interacts with water. Changing the event name now would make this a matter of finding a reason to merge code that accidentally doesn't work as intended.Please create an issue proposing what feature you want to implement. In that issue, once we've discussed the what the feature should look like, we can discuss whether the code here is appropriate for that. In your issue, please try and provide answers to the questions written here. (Yes, it's a link to Windows Calculator's repo. See #887 for more context on what a "proposal" means.)
sure even if #1426 exists?
GTA SA store IN_WATER state in physical flags. You can add onClientElementPhysicalStateChanged ( oldState, newState ) for peds/vehicles/obejct. oldState - physical flags before GTA call ProcessControl, newState - after ProcessControl. You can find ProcessControl hooks in multiplayer_keysync.cpp
If you want to add serverside event, you don't need save last isWater state.
if (flags.data.bIsInWater != pVehicle->IsInWater()) { ... }
Correct me if it's wrong
If you want to add serverside event, you don't need save last isWater state.
if (flags.data.bIsInWater != pVehicle->IsInWater()) { ... }Correct me if it's wrong
cheers gonna try I've seen flag code somewhere I'll try it
This draft pull request is stale because it has been open for at least 90 days with no activity. Please continue on your draft pull request or it will be closed in 30 days automatically.
This draft pull request was closed because it has been marked stale for 30 days with no activity.
Why we need It?
Well looks like we have
onVehicleExplodeand many other vehicle events but we don't have this one, also as requested in issue #1426, this PR introduces a new event in MTA since not everyone can usecolsetc... and It's better than adding atimeror callingonClientRenderor something to check if the element isInWater.(Also this event is triggered for unoccupied vehicles too)
Functionality
This event is triggered when a vehicle drowns.
Screenshots
tete