Raised This Month: $ Target: $400
 0% 

ERROR 018: initalization data exceeds declared size


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Adomaz1
Senior Member
Join Date: Feb 2014
Old 03-10-2014 , 09:55   ERROR 018: initalization data exceeds declared size
Reply With Quote #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.
Adomaz1 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 05:54.


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