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

rcon_hidden


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
chaves
Senior Member
Join Date: Oct 2011
Old 06-05-2017 , 21:14   rcon_hidden
Reply With Quote #1

I wonder why the error and how to solve it.


L 06/05/2017 - 21:49:54: Start of error session.
L 06/05/2017 - 21:49:54: Info (map "aim_headshot") (file "addons/amxmodx/logs/error_20170605.log")
L 06/05/2017 - 21:49:54: Invalid array handle provided (0)
L 06/05/2017 - 21:49:54: [AMXX] Displaying debug trace (plugin "rcon_hidden.amxx")
L 06/05/2017 - 21:49:54: [AMXX] Run time error 10: native error (native "ArrayDestroy")
L 06/05/2017 - 21:49:54: [AMXX] [0] rcon_hidden.sma::plugin_end (line 80)
Attached Files
File Type: sma Get Plugin or Get Source (rcon_defencer.sma - 462 views - 2.7 KB)
chaves is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-06-2017 , 07:55   Re: rcon_hidden
Reply With Quote #2

It's using ArrayDestroy() but the array isn't created with ArrayCreate() because the cvar isn't enabled.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
chaves
Senior Member
Join Date: Oct 2011
Old 06-06-2017 , 14:11   Re: rcon_hidden
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
It's using ArrayDestroy() but the array isn't created with ArrayCreate() because the cvar isn't enabled.

Can you help me or do not have a solution?
chaves is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-06-2017 , 14:32   Re: rcon_hidden
Reply With Quote #4

Well simply check if the cvar is enabled before using the function.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
chaves
Senior Member
Join Date: Oct 2011
Old 06-06-2017 , 14:52   Re: rcon_hidden
Reply With Quote #5

Quote:
Originally Posted by OciXCrom View Post
Well simply check if the cvar is enabled before using the function.
The .sma is posted attached, can you correct it if it is the case or post here the edition that I should do?

Thanks for the quick response
chaves is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 06-06-2017 , 15:04   Re: rcon_hidden
Reply With Quote #6

You're in scripting section, you should post here if you know at least basics stuffs... you should do something like that:
PHP Code:
if( get_pcvar_num( ... ) )
{
        
ArrayDestroy( ... );

__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-06-2017 , 23:56   Re: rcon_hidden
Reply With Quote #7

Looks to me that there is a bigger issue here. What happens if the cvar gets changed after plugin_cfg() and before plugin_end()? Probably nothing major but that doesn't make it good code. You should check to see if the array is valid, if it's valid, destroy it instead of relying on the cvar.

I'm guessing you can simply check if(g_a_IP) instead of checking the cvar.
__________________
fysiks 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 08:17.


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