Raised This Month: $ Target: $400
 0% 

ERROR 018: initalization data exceeds declared size


Post New Thread Reply   
 
Thread Tools Display Modes
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
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 03-10-2014 , 10:08   Re: ERROR 018: initalization data exceeds declared size
Reply With Quote #2

How is ITEMS defined?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Adomaz1
Senior Member
Join Date: Feb 2014
Old 03-10-2014 , 14:01   Re: ERROR 018: initalization data exceeds declared size
Reply With Quote #3

I fixed that error, but now it says that

\unlock_dmp7a1.sma(25) : error 009: invalid array size (negative or zero)
Adomaz1 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 03-10-2014 , 14:12   Re: ERROR 018: initalization data exceeds declared size
Reply With Quote #4

You cannot have an array with a size of 0
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Adomaz1
Senior Member
Join Date: Feb 2014
Old 03-10-2014 , 15:10   Re: ERROR 018: initalization data exceeds declared size
Reply With Quote #5

the script is now ok, but there isn't any gun upgrade in the game..:/
Adomaz1 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 03-10-2014 , 15:21   Re: ERROR 018: initalization data exceeds declared size
Reply With Quote #6

Well, attach the SMA and the required files and describe what should be occuring
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Reply


Thread Tools
Display Modes

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