[Tutorial] How to prevent damage
#9

As already stated by CalcinC, OnPlayerGiveDamage is no different than OnPlayerTakeDamage when it comes to damage prevention. The only difference is that OnPlayerGiveDamage handles damage clientside whereas OnPlayerTakeDamage does it serverside. Generally, I would never recommend letting the client handle damage. As far as I recall, OnPlayerGiveDamage is also called if you shoot someone who is actually out of shot range.

And no, OnPlayerUpdate is the absolute worst way of doing it. Again, it behaves just like the other callbacks. You'd only have to implement an if-clause that checks for incoming damage. The if-clause would be called 30-50 times per second though, so you definitely don't want to be using that.
Reply


Messages In This Thread
How to prevent damage - by Manyula - 04.05.2016, 10:47
Re: How to prevent damage - by Wolfe - 04.05.2016, 11:54
Re: How to prevent damage - by CalvinC - 04.05.2016, 12:14
Re: How to prevent damage - by Wolfe - 04.05.2016, 12:17
Re: How to prevent damage - by F1N4L - 04.05.2016, 12:25
Re: How to prevent damage - by CalvinC - 04.05.2016, 12:33
Re: How to prevent damage - by F1N4L - 04.05.2016, 12:45
Re: How to prevent damage - by SyS - 04.05.2016, 14:45
Re: How to prevent damage - by Manyula - 04.05.2016, 16:19

Forum Jump:


Users browsing this thread: 1 Guest(s)