Raised This Month: $ Target: $400
 0% 

[HELP] Run time error 4: index out of bounds


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-24-2015 , 10:07   Re: [HELP] Run time error 4: index out of bounds
Reply With Quote #4

Show the definition for these 2 arrays:

gKillerID[]
gHPKiller[]

Try this
PHP Code:
#include <amxmodx>
#include <hamsandwich>

const MAXPLAYERS 32;

new 
gKillerIDMAXPLAYERS ];
new 
gHPKillerMAXPLAYERS ];

#define IsPlayer(%1)    (1<=%1<=MAXPLAYERS)

public plugin_init() 
{
    
RegisterHamHam_Killed "player" "PlayerDeath" 
}

public 
PlayerDeathvictim attacker )
{
    new 
vicname[32]
    new 
killname[32]
    new 
health

    
if( IsPlayerattacker ) && victim != attacker && is_user_connectedattacker ) )
    {
        
health get_user_health(attacker);
        
gKillerID[victim] = attacker;
        
        
get_user_name(victim,vicname,31);
        
get_user_name(attacker,killname,31);
        
client_print(victim,print_chat,"[ %s te matou, ficando com %i HP ]",killname,health);
        
        
gHPKiller[attacker] = health;
    }
    else
    {
        
client_printvictim print_chat "Attacker is self, not a player, or left the server" );
    }

__________________

Last edited by Bugsy; 10-24-2015 at 10:14.
Bugsy 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 22:16.


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