Raised This Month: $12 Target: $400
 3% 

[FAKEMETA] unregister_forward can cause runtime errors


  
 
 
Thread Tools Display Modes
Author Message
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-27-2007 , 21:58   [FAKEMETA] unregister_forward can cause runtime errors
#1

The idea is to only have the forward running when you need it. Example code:

Code:
#include <amxmodx>  #include <fakemeta>  new fwdTraceLine;  public plugin_init()  {     register_concmd("register","register");     register_concmd("unregister","unregister");  }  public register(id)  {     fwdTraceLine = register_forward(FM_TraceLine,"fw_traceline",1);     console_print(id,"* Registered FM_TraceLine: %i",fwdTraceLine);     return PLUGIN_HANDLED;  }  public unregister(id)  {     console_print(id,"* Unregistering FM_TraceLine: %i -- Result: %i",fwdTraceLine,unregister_forward(FM_TraceLine,fwdTraceLine,1));     fwdTraceLine = 0;     return PLUGIN_HANDLED;  }  public fw_traceline(Float:start[3],Float:end[3],noMonsters,id,trace)  {     return FMRES_IGNORED;  }

Code:
] register
* Registered FM_TraceLine: 369
] unregister
* Unregistering FM_TraceLine: 369 -- Result: 1
This works alright. But then, once I add a bot:

Code:
] bot_add_ct
"bot_quota" changed to "1"
bot] Alfred connected
bot] Alfred is joining the Counter-Terrorist force
Scoring will not start until both teams have players
L 01/27/2007 - 21:07:31: [AMXX] Forwards with more than 32 parameters are not supported (tried to prepare array # 33).
L 01/27/2007 - 21:07:31: [AMXX] Forwards with more than 32 parameters are not supported (tried to prepare array # 33).
L 01/27/2007 - 21:07:31: [AMXX] Forwards with more than 32 parameters are not supported (tried to prepare array # 33).
Rinse and repeat the error message. The error stops appearing if I register the forward again, or remove the bot. I'm not sure if this only occurs with bots or with any other clients besides the host.

I'm using AMXX 1.76c on a CZ listen server. I've tried this running only the exampe plugin (not even any of the AMXX base plugins), and it still occurs, albeit the forward index is much lower.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS

Last edited by XxAvalanchexX; 01-27-2007 at 22:39.
XxAvalanchexX is offline
BAILOPAN
Join Date: Jan 2004
Old 01-28-2007 , 00:02   Re: [FAKEMETA] unregister_forward can cause runtime errors
#2

This is fixed as revision 3269. Please try the attached binary before I lock this.
Attached Files
File Type: dll fakemeta_amxx.dll (224.0 KB, 381 views)
__________________
egg
BAILOPAN is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-28-2007 , 01:32   Re: [FAKEMETA] unregister_forward can cause runtime errors
#3

Using that binary, the runtime error no longer appears, and the forward registers and unregisters properly (tested with a client_print).

Thanks!
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS

Last edited by XxAvalanchexX; 01-28-2007 at 01:50.
XxAvalanchexX is offline
 


Thread Tools
Display Modes

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 07:52.


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