Raised This Month: $ Target: $400
 0% 

ArrayPushString


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 04-12-2017 , 22:41   ArrayPushString
Reply With Quote #1

What's wrong here?

Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "author" new Array:g_arrSkin = Invalid_Array public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         g_arrSkin = ArrayCreate() } public plugin_end() {     ArrayDestroy(g_arrSkin) }   public plugin_precache() {     new szFile[256]     get_configsdir(szFile, charsmax(szFile))     formatex(szFile, charsmax(szFile), "%s/skins.ini",szFile)     new iFile = fopen(szFile, "r")         if(!iFile)     {         new szFmt[100]                 formatex(szFmt, charsmax(szFmt), "Archive ^"%s^" does not exist!", szFile)         set_fail_state(szFmt)     }     while (!feof(iFile))     {         new szBuffer[512], szSkin[64]         fgets(iFile, szBuffer, charsmax(szBuffer))         trim(szBuffer)                 switch(szBuffer[0])         {             case EOS, ';': continue             default:             {                 parse(szBuffer, szSkin, charsmax(szSkin))                 trim(szBuffer)                                 if(file_exists(szSkin))                 {                     ArrayPushString(g_arrSkin, szSkin)                     precache_model(szSkin)                                         console_print(0, "%s", szSkin)                     console_print(0, "%s", ArrayGetStringHandle(g_arrSkin, random_num(0, ArraySize(g_arrSkin))))                 }             }         }     } }

Error:

Code:
L 04/12/2017 - 23:40:32: Invalid array handle provided (0)
L 04/12/2017 - 23:40:32: [AMXX] Displaying debug trace (plugin "aaa.amxx")
L 04/12/2017 - 23:40:32: [AMXX] Run time error 10: native error (native "ArrayPushString")
L 04/12/2017 - 23:40:32: [AMXX]    [0] aaa.sma::plugin_precache (line 55)
skins.ini:

Code:
models/v_awp.mdl
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
 



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 17:56.


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