A Question About "return PLUGIN_HANDLED" & "return PLUGIN_CONTINUE"
I'm in a logic error with those two ones..
I'll try to explain on my plugin.. This is my plugin, it spawns players when they write "/spawn" in say or say_team and if player has enough money for it. Code:
#include <amxmodx>I put the code "return PLUGIN_HANDLED" under this line as you see: Code:
Or.. I put the same return code at the end of "Event_Spawn" Public. What also does it do in there, it stops the plugin when all tasks done, is it right? Can't be sure. |
Re: A Question About "return PLUGIN_HANDLED" & "return PLUGIN_CONTINUE"
Instead of using cs_user_spawn (id), I would use hamsandwich ExecuteHamB (Ham_CS_RoundRespawn, id), otherwise there are several and various topics related to "returns", use the search.
|
Re: A Question About "return PLUGIN_HANDLED" & "return PLUGIN_CONTINUE"
Quote:
It would be better if you ask me any question like "Do you know how to use hamsandwich?" before suggested the ExecuteHamB native. And yes, Hamsandwich seems more appropriate module as I heard but first I should finish the easier ones. Hope there'll be some real helpers. |
Re: A Question About "return PLUGIN_HANDLED" & "return PLUGIN_CONTINUE"
I did not understand the problem, "learn how to use ham sandwich" ??
I've given you the full function, you just have to add it to the top of the #include <hamsandwich> plugin, but do as you wish! |
Re: A Question About "return PLUGIN_HANDLED" & "return PLUGIN_CONTINUE"
Quote:
The only one problem that I have, I can't get all the Amx Mod X or software phrases. And, I have explained what I want to learn as full in this subject. I'm just in a logic error. |
Re: A Question About "return PLUGIN_HANDLED" & "return PLUGIN_CONTINUE"
PLUGIN_HANDLED in this case will block the /spawn command from showing in chat and will stop any other plugin from hooking it.
If it was PLUGIN_CONTINUE, the command would show in chat. PLUGIN_HANDLED_MAIN will hide the command in chat, but won't stop any other plugins from hooking it. It doesn't affect anything else in this case. |
Re: A Question About "return PLUGIN_HANDLED" & "return PLUGIN_CONTINUE"
Quote:
And, does it block the other lines / cases in the plugin? For an example, I'm meaning: Code:
if(cs_get_user_money(id) < get_pcvar_num(gMoney))Code:
else if(cs_get_user_money(id) >= get_pcvar_num(gMoney)) |
Re: A Question About "return PLUGIN_HANDLED" & "return PLUGIN_CONTINUE"
1. The compiler will say you that a function must return a value (use return).
2. 'return' means 'immediate exit from function'. |
| All times are GMT -4. The time now is 07:35. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.