Captain07 Posted June 5, 2021 Share Posted June 5, 2021 Hello, I'm looking for a way to detect throwing a grenade/molotov/etc. onClientPlayerWeaponFire doesn't trigger for this. I was thinking about onClientKey + getPedWeapon, but my server has many situations where the "fire" control is disabled, so you can't shoot/throw a grenade. (Safe zone, god mode, and much more) So it would be really painful to put them in an "if" as exceptions and I might miss some of them. So onClientKey is very tricky, but I don't have a better solution. If someone has an idea, can they share with me/us, please? Thanks for reading! Link to comment
Moderators Patrick Posted June 5, 2021 Moderators Share Posted June 5, 2021 Hi. There is a dedicated event for this: https://wiki.multitheftauto.com/wiki/OnClientProjectileCreation Event's first parameter is the creator who throws the projectile. Cancel effect This event cannot be cancelled. To remove the projectile you can use setElementPosition (some where far away) and then destroyElement (which makes it explode). 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now