AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Index out of bounds (https://forums.alliedmods.net/showthread.php?t=229860)

Andu. 11-16-2013 04:48

Index out of bounds
 
I have this problem

PHP Code:

L 11/16/2013 03:07:48: [AMXXDisplaying debug trace (plugin "bpammo.amxx")
L 11/16/2013 03:07:48: [AMXXRun time error 4index out of bounds 
L 11
/16/2013 03:07:48: [AMXX]    [0bpammo.sma::Message_AmmoX (line 64

with this plugin

PHP Code:

#include <amxmodx>
#include <fakemeta>

#define VERSION "0.0.1"

enum
{
    
AmmoX_AmmoID 1,
    
AmmoX_Ammount
}

enum
{
    
ammo_none,
    
ammo_338magnum 1// 30
    
ammo_762nato// 90
    
ammo_556natobox// 200
    
ammo_556nato// 90
    
ammo_buckshot// 32
    
ammo_45acp// 100
    
ammo_57mm// 100
    
ammo_50ae// 35
    
ammo_357sig// 52
    
ammo_9mm// 120
    
ammo_flashbang// 2
    
ammo_hegrenade// 1
    
ammo_smokegrenade// 1
    
ammo_c4 // 1
}

new const 
g_iMaxBpAmmo[] = {
    
0,
    
30,
    
90,
    
200,
    
90,
    
32,
    
100,
    
100,
    
35,
    
52,
    
120,
    
2,
    
1,
    
1,
    
1
}

#define XO_PLAYER 5
#define m_rgpPlayerItems_0 376

public plugin_init()
{
    
register_plugin("Infinite BpAmmo"VERSION"ConnorMcLeod")
    
register_message(get_user_msgid("AmmoX"), "Message_AmmoX")
}

public 
Message_AmmoX(iMsgIdiMsgDestid)
{
    new 
iAmmoID get_msg_arg_int(AmmoX_AmmoID)

    if(
is_user_alive(id) && iAmmoID )
    {
        new 
iMaxBpAmmo g_iMaxBpAmmo[iAmmoID]
        if( 
get_msg_arg_int(AmmoX_Ammount) < iMaxBpAmmo )
        {
            
#if defined UNLIMITED_NADES
            
if( iAmmoID ammo_c4 )
            
#else
            
if( iAmmoID <= ammo_9mm )
            
#endif
            
{
                
set_msg_arg_int(AmmoX_AmmountARG_BYTEiMaxBpAmmo)
                
set_pdata_int(idm_rgpPlayerItems_0 iAmmoIDiMaxBpAmmoXO_PLAYER)
            }
        }
    }



GsiX 11-16-2013 05:17

Re: Index out of bounds
 
wrong place..


All times are GMT -4. The time now is 08:55.

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