Raised This Month: $32 Target: $400
 8% 

Possible to suppress run-time errors?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 12-18-2006 , 17:12   Possible to suppress run-time errors?
Reply With Quote #1

Is it possible to suppress run-time errors?

For example, I hate seeing invalid player everywhere when it just so happens the player disconnected and the code is still running...

Just sucks to have to throw an is_user_connected everywhere...

Is there a better way?

Thanks,
Josh
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 12-18-2006 , 17:50   Re: Possible to suppress run-time errors?
Reply With Quote #2

you can use set_native_filter for this
http://www.amxmodx.org/funcwiki.php?go=func&id=888
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 12-18-2006 , 17:54   Re: Possible to suppress run-time errors?
Reply With Quote #3

Good call thanks - so I would jsut compare the name[] to whatever function generated the error? (function being like cs_get_user_money)

Code:
public native_filter( const name[], index, trap )
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 12-18-2006 , 17:59   Re: Possible to suppress run-time errors?
Reply With Quote #4

to get the error number/string( Runtime Error x: ) you can use the dbg_* functions
http://www.amxmodx.org/funcwiki.php?...dbg_&go=search

if you want to remove all runtime errors just use "return 1" inside of you handler
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 12-24-2006 , 12:30   Re: Possible to suppress run-time errors?
Reply With Quote #5

So I've been looking into this and can't figure it out - native_filter is only called when you have a native in your plugin that doesn't exist - i.e. the module didn't load...

It doesn't handle runtime errors... right?
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 12-24-2006 , 12:31   Re: Possible to suppress run-time errors?
Reply With Quote #6

Nvmd - http://www.amxmodx.org/funcwiki.php?...lter&go=search
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
Reply


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 23:03.


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