Scripting Moderators ds1-e Posted December 19, 2018 Scripting Moderators Share Posted December 19, 2018 (edited) Hey, i have noticed a problem with that event. Weapons which cause explosions, for example: 51, 19, as topic say execute 1-4 times. Any idea how to fix it? Another question associated with this, it's possible/worth to move damage system (functions) on server side? It happens mostly with car explosion, example function below. function damage(attacker, weapon, bodypart, loss) cancelEvent() outputChatBox(weapon) end addEventHandler("onClientPlayerDamage", getLocalPlayer(), damage) Edited December 19, 2018 by majqq Link to comment
Moderators IIYAMA Posted December 20, 2018 Moderators Share Posted December 20, 2018 1. Not really. It probably has multiple damage layers. 2. You can't cancel damage serverside, as that event triggers much too late. There is connection delay (ping). By the time you reset the health, the player might have been (insta) killed already. Possible solution for an overwrite: https://wiki.multitheftauto.com/wiki/OnClientExplosion cancelEvent() https://wiki.multitheftauto.com/wiki/CreateExplosion 1 Link to comment
Scripting Moderators ds1-e Posted March 14, 2019 Author Scripting Moderators Share Posted March 14, 2019 bump. Still looking for fix, it's annoying when player got double damage from just only one explosion... Link to comment
Mr.Loki Posted March 14, 2019 Share Posted March 14, 2019 Use a timer or getTickCount to create a delay if the damage is 51 or 19 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