Raised This Month: $ Target: $400
 0% 

event_death [HELP]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Id0x.
Junior Member
Join Date: Dec 2020
Old 12-22-2020 , 05:21   event_death [HELP]
Reply With Quote #1

Code:
L 12/22/2020 - 06:35:04: [AMXX] Displaying debug trace (plugin "level.amxx", version "v5.2")
L 12/22/2020 - 06:35:04: [AMXX] Run time error 4: index out of bounds 
L 12/22/2020 - 06:35:04: [AMXX]    [0] phph2kN7x.sma::event_death (line 93)
PHP Code:
public event_death()
{
    new 
name[32], attacker read_data(1);
    
get_user_name(attackernamesizeof name 1); new 1;
    
    if((
g_exp[attacker] >= (g_exp2[attacker] - 1)) && (g_level[attacker] <= get_pcvar_num(g_max)) && is_user_alive(attacker))
    {
        
g_level[attacker] ++;
        
g_exp[attacker] = 0;    
        
        while(
g_level[attacker] != y)
        {
            
++; g_exp2[attacker] = 5;
        }
        
        
message_begin(MSG_ONE_UNRELIABLEg_fade_attacker);
        
write_short(1<<12);
        
write_short(1);
        
write_short(0x0000);
        
write_byte(1);
        
write_byte(200); 
        
write_byte(0);
        
write_byte(205);
        
message_end();
        
        
emit_sound(attackerCHAN_STREAMsound1.0ATTN_NORM0PITCH_HIGH);
        
ChatColor(0"!nPlayer!t %s !nUp Level to!g %d !t!"nameg_level[attacker]);
    }
    else
    {        
        if(!(
g_level[attacker] == get_pcvar_num(g_max))) g_exp[attacker] ++;            
    }

Line 93 :
PHP Code:
if((g_exp[attacker] >= (g_exp2[attacker] - 1)) && (g_level[attacker] <= get_pcvar_num(g_max)) && is_user_alive(attacker)) 
Id0x. is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-22-2020 , 07:24   Re: event_death [HELP]
Reply With Quote #2

Why simply not use this instead?
https://forums.alliedmods.net/showthread.php?t=308540

Anyways, you can probably fix the error by adding this in the beginning of the function (after the line that contains 'read_data'):

Code:
if(!is_user_connected(attacker)) return
__________________

Last edited by OciXCrom; 12-22-2020 at 07:25.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Id0x.
Junior Member
Join Date: Dec 2020
Old 12-22-2020 , 07:39   Re: event_death [HELP]
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
Why simply not use this instead?
https://forums.alliedmods.net/showthread.php?t=308540

Anyways, you can probably fix the error by adding this in the beginning of the function (after the line that contains 'read_data'):

Code:
if(!is_user_connected(attacker)) return
i want use your plugin, but the players levels will reset
Id0x. is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-22-2020 , 09:26   Re: event_death [HELP]
Reply With Quote #4

Eventually you will need to restart it. Plus, I don't think players would mind having new ranks and a better plugin for the job.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 14:11.


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