I have this problem
PHP Code:
L 11/16/2013 - 03:07:48: [AMXX] Displaying debug trace (plugin "bpammo.amxx")
L 11/16/2013 - 03:07:48: [AMXX] Run time error 4: index out of bounds
L 11/16/2013 - 03:07:48: [AMXX] [0] bpammo.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(iMsgId, iMsgDest, id)
{
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_Ammount, ARG_BYTE, iMaxBpAmmo)
set_pdata_int(id, m_rgpPlayerItems_0 + iAmmoID, iMaxBpAmmo, XO_PLAYER)
}
}
}
}