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

Run time error 4: index out of bounds


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr Zayd
Senior Member
Join Date: Jun 2014
Location: forums.alliedmods.net
Old 09-16-2015 , 12:00   Run time error 4: index out of bounds
Reply With Quote #1

Code:
L 09/16/2015 - 15:21:41: Start of error session.
L 09/16/2015 - 15:21:41: Info (map "zm_flood") (file "addons/amxmodx/logs/error_20150916.log")
L 09/16/2015 - 15:21:41: [AMXX] Displaying debug trace (plugin "protect_name.amxx")
L 09/16/2015 - 15:21:41: [AMXX] Run time error 4: index out of bounds 
L 09/16/2015 - 15:21:41: [AMXX]    [0] protect_name.sma::CreateMainMenuTask (line 1380)
L 09/16/2015 - 15:21:47: Invalid player id 97
L 09/16/2015 - 15:21:47: [AMXX] Displaying debug trace (plugin "protect_name.amxx")
L 09/16/2015 - 15:21:47: [AMXX] Run time error 10: native error (native "client_cmd")
L 09/16/2015 - 15:21:47: [AMXX]    [0] protect_name.sma::Login (line 1592)
L 09/16/2015 - 15:21:47: [AMXX]    [1] protect_name.sma::MainMenu (line 1424)
L 09/16/2015 - 15:21:47: [AMXX]    [2] protect_name.sma::Login (line 1591)
can i have help pls ? :

(line 1380)

PHP Code:
        {
            
get_user_name(idtemp_namecharsmax(temp_name))
            
client_printcolor(0"%L"LANG_SERVER"LOG_LOGING_G"prefixtemp_name)
        } 
(CreateMainMenuTask)

PHP Code:
public CreateMainMenuTask(id)
{
    
id -= TASK_MENU

    
if((!is_registered[id] && get_pcvar_float(g_regtime)) || (is_registered[id] && !is_logged[id]))
    {
        
MainMenu(id)
        
set_task(MENU_TASK_TIME"CreateMainMenuTask"id+TASK_MENU)
    }

(Login)

PHP Code:
[public Login(id)
{
    if(!
get_pcvar_num(g_on) || !data_ready || !name_checked[id])
        return 
PLUGIN_HANDLED

    
if(changing_name[id])
    {
        
client_printcolor(id"%L"LANG_SERVER"LOGIN_AFTER")
        return 
PLUGIN_HANDLED
    
}

    if(!
is_registered[id])
    {    
        
client_printcolor(id"%L"LANG_SERVER"LOG_NOTREG"prefix)
        return 
PLUGIN_HANDLED
    
}

    if(
is_logged[id])
    {
        
client_printcolor(id"%L"LANG_SERVER"LOG_LOGGED"prefix);
        return 
PLUGIN_HANDLED
    
}
    
    
read_args(typedpasscharsmax(typedpass))
    
remove_quotes(typedpass)

    if(
equal(typedpass""))
        return 
PLUGIN_HANDLED

    hash 
convert_password(typedpass)

    if(!
equal(hashpassword[id]))
    {    
        
TrieSetCell(g_login_timesg_client_data[id], ++attempts[id])
        
client_printcolor(id"%L"LANG_SERVER"LOG_PASS_INVALID"prefixattempts[id], get_pcvar_num(g_attempts))

        if(
attempts[id] >= get_pcvar_num(g_attempts))
        {
            if(
get_pcvar_num(g_count))
            {
                
g_player_time[id] = 0
                ShowTimer
(id+TASK_TIMER)
            }

            if(
get_pcvar_num(g_time))
            {
                
TrieSetCell(g_cant_login_timeg_client_data[id], time())
            }
            else
            {
                
TrieSetCell(g_cant_login_timeg_client_data[id], 0)
            }

            
params[0] = id
            params
[1] = 3
            set_task
(2.0"KickPlayer"id+TASK_KICKparamssizeof params)

            if(
get_pcvar_num(g_time))
            {    
                
set_task(get_pcvar_float(g_time), "RemoveCantLogin"0g_client_data[id], sizeof g_client_data)
            }
            return 
PLUGIN_HANDLED
        
}
        else
        {
            
client_cmd(id"messagemode Connecting")
        }
        return 
PLUGIN_HANDLED
    
}
    else
    if (!
is_user_connected(id))
    {
    return 
PLUGIN_CONTINUE
    
}
    {
        
        
is_logged[id] = true
        attempts
[id] = 0
        remove_task
(id+TASK_KICK)

        if(
get_pcvar_num(g_announce))
        {
            
get_user_name(idtemp_namecharsmax(temp_name))
            
client_printcolor(0"%L"LANG_SERVER"LOG_LOGING_G"prefixtemp_name)
        }
        else
        {
            
client_printcolor(id"%L"LANG_SERVER"LOG_LOGING"prefix)
        }
    
        
MainMenu(id)
        
client_cmd(id"jointeam")
    }
    return 
PLUGIN_CONTINUE

PHP Code:
                if(get_pcvar_num(g_chp_log))
                {
                    
log_to_file(log_file"%L"LANG_SERVER"LOGFILE_CHNG_PASS"g_client_data[id])
                }

                
MainMenu(id)
            }
            else
            {
                if(
get_pcvar_num(g_save)) 

Arrays

PHP Code:
//Start of Arrays
new configs_dir[64]
new 
cfg_file[256];
new 
reg_file[256];
new 
commands_file[256];
new 
whitelist_file[256];
new 
part_names[MAX_NAMES][32];
new 
starting_names[MAX_NAMES][32];
new 
ending_names[MAX_NAMES][32];
new 
count;
new 
sz_time[9];
new 
line 0;
new 
text[512];
new 
params[2];
new 
check_name[32];
new 
check_client_data[35];
new 
check_pass[34];
new 
check_status[11];
new 
query[512];
new 
Handle:g_sqltuple;
new 
password[33][34];
new 
typedpass[32];
new 
hash[34];
new 
pass_prefix[32];
new 
attempts[33];
new 
times[33];
new 
g_player_time[33];
new 
g_client_data[33][35];
new 
value;
new 
menu[512];
new 
keys;
new 
length;
new 
g_maxplayers;
new 
g_saytxt
new g_screenfade
new g_sync_hud
new temp1[2];
new 
temp2[2];
new 
temp_count;
new 
type;
new 
col_command;
new 
col_name;
new 
input[32];
new 
temp_name[32];
//End fo Arrays 

Last edited by Dr Zayd; 09-16-2015 at 12:04. Reason: arrays
Dr Zayd 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 02:07.


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