- #include <amxmodx>
- #include <reapi>
- public plugin_init()
- {
- // Register our plugin first
- register_plugin("Return Explaning", "1.0", "Raheem")
- // HookChains (This will be called when any player take damage)
- RegisterHookChain(RG_CBasePlayer_TakeDamage, "Fw_TakeDamage_Post", 1)
- // HookChains (This will be called just before damage take place)
- RegisterHookChain(RG_CBasePlayer_TakeDamage, "Fw_TakeDamage_Pre", 0)
- }
- public Fw_TakeDamage_Post(iVictim, iInflictor, iAttacker, Float:fDamage, bitsDamageType)
- {
- // This return exit your function you used in this plugin so the print message won't be printed
- return HC_CONTINUE;
- client_print(id, print_chat, "This message will not be printed in game!!!")
- }
- public Fw_TakeDamage_Post(iVictim, iInflictor, iAttacker, Float:fDamage, bitsDamageType)
- {
- client_print(id, print_chat, "This message will be printed in game!!!")
- // After the message printed, This return will exit this function which used in this plugin
- return HC_CONTINUE;
- }
- public Fw_TakeDamage_Pre(iVictim, iInflictor, iAttacker, Float:fDamage, bitsDamageType)
- {
- // This will exit the main function so player will not take damage at all (Exit real function which is taking damage)
- return HC_SUPERCEDE;
- }
- public Fw_TakeDamage_Pre(iVictim, iInflictor, iAttacker, Float:fDamage, bitsDamageType)
- {
- client_print(id, print_chat, "This message will appear in the game! + No damage at all")
- // The message will appear and then the real function won't be executed so no damage will take place
- return HC_SUPERCEDE;
- }
- public Fw_TakeDamage_Pre(iVictim, iInflictor, iAttacker, Float:fDamage, bitsDamageType)
- {
- // No damage will take place, Real function exit + The down client print won't be executed as this function in this plugin will exit too
- return HC_SUPERCEDE;
- client_print(id, print_chat, "This message will not appear in the game! + No damage at all")
- }
(ReAPI) AntiFlashLightSpam + ResetScore
These returns tell the function what to do now. For example take damage function (This function will be called when any player take damage):
He who fails to plan is planning to fail
Ok somehow I get it (like I don't know to code but I want to understand it atleast ) + if there isn't nothing to re-size that plugin from above.. I think that's the final for this topic. Amen!
Off-topic: hmm.. for this friday I had to make a ancient Egypt (powerpoint), best of the class lol
Off-topic: hmm.. for this friday I had to make a ancient Egypt (powerpoint), best of the class lol
Yes it's nice to know what these returns done so you understand if you need just to edit simple things. This topic will be marked as solved.
Hehe, Need any help?
He who fails to plan is planning to fail
NoNoNo, everything was already finished and reviewed by teacher ^_^ 33 slides of Egypt, about 10hours of work :X *effort was good enough for the best callificative in the classroom #rekt)
Nice, Good luck and hope you best in your studies : )
He who fails to plan is planning to fail
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute
Sign in
Who is online
Users browsing this forum: No registered users and 9 guests