|
Author
|
Message
|
|
Senior Member
|

03-10-2014
, 09:55
ERROR 018: initalization data exceeds declared size
|
#1
|
hello, I'm getting this error when I compile: error 018: initalization data exceeds declared size.
here is the code:
Quote:
#include < amxmodx >
#include < fakemeta >
#include < hamsandwich >
#include < gunxpmod >
enum _:ITEMS
{
ITEM_MAC10 = 0,
};
new const g_pluginName[ ] = "Unlock - Weapons";
new const g_pluginVersion[ ] = "1.0";
new const g_pluginAuthor[ ] = "Adomaz";
new const g_itemName[ 0 ][ ] = { "Upgrade DMP7A1 (Dual MAC)" };
new const g_itemDescription[ 0 ][ ] = { "+Aim +Rate +Power +Scope ( MAC10 )", "Hight Damage" };
new const g_itemCost[ 0 ] = { 500 };
new const g_weaponsIndex[ 0 ] = { CSW_MAC10 };
new const g_weaponsModel[ 0 ][ ] = { "models/gunxpmod/v_dmp7a1.mdl" };
new const g_cvarName[ 0 ][ ] = { "gxm_damage_mac10" };
new const g_cvarValue[ 0 ][ ] = { "2.0" };
new bool:g_hasItem[ 33 ] [ 0 ];
new g_pItemDamage[ 3 ];
new g_itemCount;
public plugin_precache( )
{
for( new i = ITEM_MAC10; i < sizeof g_weaponsModel; i++ )
engfunc( EngFunc_PrecacheModel, g_weaponsModel[ i ] );
}
public plugin_init( )
{
register_plugin( g_pluginName, g_pluginVersion, g_pluginAuthor );
for( new i = ITEM_MAC10; i < g_itemCount; i++ )
{
register_gxm_item( g_itemName[ i ], g_itemDescription[ i ], g_itemCost[ i ] );
g_pItemDamage[ i ] = register_cvar( g_cvarName[ i ], g_cvarValue[ i ] );
g_itemCount++;
}
register_event( "CurWeapon", "eventCurWeapon", "be", "1=1" );
RegisterHam( Ham_TakeDamage, "player", "hookClientTakeDamage" );
}
public gxm_item_enabled( client )
{
for( new i = ITEM_MAC10; i < g_itemCount; i++ )
g_hasItem[ client ][ i ] = true;
}
public client_connect( client )
{
for( new i = ITEM_MAC10; i < g_itemCount; i++ )
g_hasItem[ client ][ i ] = false;
}
public hookClientTakeDamage( client, inflictor, attacker, Float:damage, damageType )
{
for( new i = ITEM_MAC10; i < g_itemCount; i++ )
{
if( !g_hasItem[ attacker ][ i ] )
continue;
new weapon = get_user_weapon(attacker, _, _);
if( weapon == g_weaponsIndex[ i ] )
{
SetHamParamFloat( 4, damage * get_pcvar_float( g_pItemDamage[ i ] ) );
return HAM_SUPERCEDE;
}
}
return HAM_IGNORED;
}
public eventCurWeapon( client )
{
for( new i = ITEM_MAC10; i < g_itemCount; i++ )
{
if( !g_hasItem[ client ][ i ] )
continue;
new weapon = read_data( 2 );
if( weapon == g_weaponsIndex[ i ] )
set_pev( client, pev_viewmodel2, g_weaponsModel[ i ] );
}
}
|
Last edited by Adomaz1; 03-10-2014 at 14:00.
|
|
|
|