Raised This Month: $ Target: $400
 0% 

Ham_TakeDamage Pre issues


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-13-2014 , 01:17   Re: Ham_TakeDamage Pre issues
Reply With Quote #1

If you want that another plugin than the one you are showing can detect that your plugin has blocked the function, then you have to declare your plugin before the second one in plugins.ini

And in the other plugin (main ZP plugin from what i understand), you have to check the return status when the forward is called

if( GetHamReturnStatus() == HAM_SUPERCEDE ) return;

Something like that.



Also, in your code, 1st return should be HAM_IGNORED (you don't do anything), seconde return is correct (you want to block damage), and last return should be HAM_HANDLED (you have changed something but you don't want to block).
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 01-13-2014 , 11:23   Re: Ham_TakeDamage Pre issues
Reply With Quote #2

Quote:
Originally Posted by NiHiLaNTh View Post
for bots you have to use RegisterHamFromEntity
in client_authorized forward right?

Quote:
Originally Posted by ConnorMcLeod View Post
If you want that another plugin than the one you are showing can detect that your plugin has blocked the function, then you have to declare your plugin before the second one in plugins.ini
so zombie_plague.amxx should come after my zombieclass in plugins.ini, that wont give problems?

Quote:
Originally Posted by ConnorMcLeod View Post
And in the other plugin (main ZP plugin from what i understand), you have to check the return status when the forward is called

if( GetHamReturnStatus() == HAM_SUPERCEDE ) return;

Something like that.
But I am using a forward from hamsandwich, not a forward from ZP so how can i do that?
In Ham_TakeDamage pre hook from zombieplague? will the main zp be able to pick up on the returned value from my zombieclass because my class loaded first, then zp?


Quote:
Originally Posted by ConnorMcLeod View Post
Also, in your code, 1st return should be HAM_IGNORED (you don't do anything), seconde return is correct (you want to block damage), and last return should be HAM_HANDLED (you have changed something but you don't want to block).
Ok ill try to keep that in mind. but when the forward comes from a custom plugin, the coder should still implement the possible return vallues to act on them? the return vallues are not by default in every plugin if it uses hamsandwich?

Thanks for the help so far guys
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]
striker07 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:09.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode