Raised This Month: $ Target: $400
 0% 

Run time error 4: index out of bounds


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
saitama19
Junior Member
Join Date: Feb 2017
Old 06-10-2017 , 16:28   Run time error 4: index out of bounds
Reply With Quote #1

Code:
L 06/10/2017 - 17:46:01: [AMXX] Displaying debug trace (plugin "block_nicks.amxx")
L 06/10/2017 - 17:46:01: [AMXX] Run time error 4: index out of bounds 
L 06/10/2017 - 17:46:01: [AMXX]    [0] block_nicks.sma::client_putinserver (line 30)
L 06/10/2017 - 17:46:01: [AMXX] Displaying debug trace (plugin "block_nicks.amxx")
L 06/10/2017 - 17:46:01: [AMXX] Run time error 4: index out of bounds 
L 06/10/2017 - 17:46:01: [AMXX]    [0] block_nicks.sma::client_infochanged (line 41)
L 06/10/2017 - 17:46:01: [AMXX] Displaying debug trace (plugin "block_nicks.amxx")
L 06/10/2017 - 17:46:01: [AMXX] Run time error 4: index out of bounds 
L 06/10/2017 - 17:46:01: [AMXX]    [0] block_nicks.sma::client_infochanged (line 41)
L 06/10/2017 - 17:46:01: [AMXX] Displaying debug trace (plugin "block_nicks.amxx")
L 06/10/2017 - 17:46:01: [AMXX] Run time error 4: index out of bounds

block_nicks.sma
Spoiler


someone, can fix this code please

Last edited by saitama19; 06-10-2017 at 16:29.
saitama19 is offline
ComedyShotsGamer
Senior Member
Join Date: Mar 2016
Old 06-10-2017 , 16:59   Re: Run time error 4: index out of bounds
Reply With Quote #2

Delete

Last edited by ComedyShotsGamer; 06-10-2017 at 17:19.
ComedyShotsGamer is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 06-10-2017 , 17:01   Re: Run time error 4: index out of bounds
Reply With Quote #3

How many lines do you have in the name file? My spontanious thought here is that you have more than 410.
__________________
Black Rose is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-10-2017 , 17:26   Re: Run time error 4: index out of bounds
Reply With Quote #4

PHP Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Block Nick"
#define VERSION "1.0"
#define AUTHOR "unknown"

new Array:g_array;

public 
plugin_init() {
    
register_plugin("Block Nick","1.0","unknown")
}
public 
plugin_end() ArrayDestroy(g_array)
public 
plugin_cfg()
{
    
g_array ArrayCreate(321);
    new 
config[64]
    
get_configsdir(config,63)
    
format(config,63,"%s/BlockedNicks.ini",config)
    
    new 
fpname[32];
    if((
fp fopen(config"rt")) > 0)
    { while(!
feof(fp)) { 
           
fgets(fpname31)
           if(!
name[0] || name[0] == ';') continue;
           
ArrayPushString(g_arrayname)
       }
       
fclose(fp)
    }
    else if(!
file_exists(fp))
              
write_file(config,"",-1)
}

public 
client_putinserver(id) {
    new 
newname[32
    
get_user_info(idnewname,31
    if(
SearchTheArray(newname))
          
server_cmd("kick #%d  Change your name!"get_user_userid(id))
}

public 
client_infochanged(id) { 
    new 
newname[32
    
get_user_info(idnewname,31
    if(
SearchTheArray(newname))
          
server_cmd("kick #%d  Change your name!"get_user_userid(id))


SearchTheArray(const name[])
{
       new 
size ArraySize(g_array), nname[32];
       for(new 
0sizei++)
       {
              
ArrayGetString(g_arrayinname31)
              if(
containi(namenname) > -1) return true;
       }
       return 
false;

Tired and retarded, here you go,btw this plugin dose exists if you only search you will help.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 06-10-2017 at 17:47.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
saitama19
Junior Member
Join Date: Feb 2017
Old 06-10-2017 , 17:40   Re: Run time error 4: index out of bounds
Reply With Quote #5

Quote:
Originally Posted by Natsheh View Post
PHP Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Block Nick"
#define VERSION "1.0"
#define AUTHOR "unknown"

new Array:g_array;

public 
plugin_init() {
    
register_plugin("Block Nick","1.0","unknown")
}
public 
plugin_end() ArrayDestroy(g_array)
public 
plugin_cfg()
{
    
g_array ArrayCreate(321);
    new 
config[64]
    
get_configsdir(config,63)
    
format(config,63,"%s/BlockedNicks.ini",config)
    
    new 
fpname[32];
    if((
fp fopen(config"rt")) > 0)
    { while(!
feof(fp)) { 
           
fgets(fpname31)
           if(!
name[0] || name[0] == ';') continue;
           
ArrayPushString(g_arrayname);
       }
       
fclose(fp);
    }
    else if(!
file_exists(fp))
              
write_file(config,"",-1)
}

public 
client_putinserver(id) {
    new 
newname[32
    
get_user_info(idnewname,31
    if(
SearchTheArray(newname))
          
server_cmd("kick #%d  Change your name!"get_user_userid(id))
}

public 
client_infochanged(id) { 
    new 
newname[32
    
get_user_info(idnewname,31
    if(
SearchTheArray(newname))
          
server_cmd("kick #%d  Change your name!"get_user_userid(id))


SearchTheArray(const name[])
{
       new 
size ArraySize(g_array), nname[32];
       for(new 
0sizei++)
       {
              
ArrayGetString(g_arrayinname31)
              if(
containi(nnamename) > -1) return true;
       }
       return 
false;

Tired and retarded, here you go,btw this plugin dose exists if you only search you will help.


Last edited by saitama19; 06-10-2017 at 17:45.
saitama19 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-10-2017 , 17:46   Re: Run time error 4: index out of bounds
Reply With Quote #6

I updated the code. Added semicolon to the loop instead of ,
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 06-10-2017 at 17:48.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 15:26.


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