Doubt about ham take damage (Ham_TakeDamage)
Hello. The last days I'm asking myself something...
What's happens if I have multiple plugins with Ham_Takedamage and a SetHamParamFloat for damage in each?. For example Plugin 1 (just pseudocode for understanding): Quote:
Quote:
Thanks you. |
Re: Doubt about ham take damage (Ham_TakeDamage)
If it works like all other forwards and natives: the last param (from the last plugin in the list) will be returned to the engine.
Most precise they will override each other. |
Re: Doubt about ham take damage (Ham_TakeDamage)
Can anyone confirm if is like this with ham takedamage?
Quote:
|
Re: Doubt about ham take damage (Ham_TakeDamage)
Test with yourself. Just change the position of the plugins in plugins.ini and check what occurs.
|
Re: Doubt about ham take damage (Ham_TakeDamage)
Last one from plugins.ini will be called first (if both are called in same forward i.e. plugin_init)
|
Re: Doubt about ham take damage (Ham_TakeDamage)
Quote:
A good example for this is why we (or at least I do) always put gag plugins on top of plugins.ini, so they can block adminchat.amxx. |
Re: Doubt about ham take damage (Ham_TakeDamage)
In his situation the plugin on the bottom has more priority, because he is returning 0 in both functions.
The damage will be changed twice and the final value will be the plugin on bottom. |
Re: Doubt about ham take damage (Ham_TakeDamage)
Quote:
Function A => Original Function and after 2nd hook it would be: Function B => Function A => Original Function (Cause function that will be replaced is Function A & not Orignal Function or something else). Note: Function A is in Plugin A which is first in plugins.ini :) & Plugin B (Function B) is last one. |
Re: Doubt about ham take damage (Ham_TakeDamage)
Yeah, this case is different because he isn't "blocking" the forward. The final damage will be 500.
|
Re: Doubt about ham take damage (Ham_TakeDamage)
Quote:
The Damage will be 200. |
| All times are GMT -4. The time now is 04:38. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.