Raised This Month: $18 Target: $400
 4% 

Error 052: Multi-dimensional arrays must be fully initialized


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SkatInfinity
Junior Member
Join Date: Sep 2012
Old 09-10-2012 , 11:47   Error 052: Multi-dimensional arrays must be fully initialized
Reply With Quote #1

I really don't know what's wrong.

I get the error here ↓

Code:
new g_iWeapName[g_iWeapCount][] =

{
	"weapon_fiveseven",
	"weapon_deagle",
	"weapon_awp",
	"weapon_m3",
	"weapon_m4a1",
	"",
	"weapon_hegrenade",
	""
};
and here ↓

Code:
new const g_iWeapShort[g_iWeapCount][] =
{
	"%",
	"%",
	"%",
	"%",
	"%",
	"%",
	" Bullets",
	" Bullets",
	" Bullets",
	" Bullets",
	" Bullets"
	
}
SkatInfinity is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 09-10-2012 , 12:20   Re: Error 052: Multi-dimensional arrays must be fully initialized
Reply With Quote #2

g_iWeapCount has to be constant.
Either make it a conostant/defined or get rid of it in defining the arrays. I suggest the later.
You should also make the first array const as well
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
SkatInfinity
Junior Member
Join Date: Sep 2012
Old 09-10-2012 , 14:09   Re: Error 052: Multi-dimensional arrays must be fully initialized
Reply With Quote #3

I've tried and can't get that to work correctly.

Last edited by SkatInfinity; 09-10-2012 at 15:49.
SkatInfinity is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 09-10-2012 , 14:15   Re: Error 052: Multi-dimensional arrays must be fully initialized
Reply With Quote #4

PHP Code:
new g_iWeapCount 11

new g_iWeapName[g_iWeapCount][] =
{
    
"weapon_fiveseven",
    
"weapon_deagle",
    
"weapon_awp",
    
"weapon_m3",
    
"weapon_m4a1",
    
"",
    
"weapon_hegrenade",
    
"",
    
"",
    
"",
    
""
}

new const 
g_iWeapShort[g_iWeapCount][] =
{
    
"%",
    
"%",
    
"%",
    
"%",
    
"%",
    
"%",
    
" Bullets",
    
" Bullets",
    
" Bullets",
    
" Bullets",
    
" Bullets"

You must define all of the values in the array
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (intervening in a thread, 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
SkatInfinity
Junior Member
Join Date: Sep 2012
Old 09-10-2012 , 14:30   Re: Error 052: Multi-dimensional arrays must be fully initialized
Reply With Quote #5

I've got more errors when i did that.
SkatInfinity is offline
Old 09-10-2012, 15:23
lillen1337
This message has been deleted by YamiKaitou. Reason: spam
Old 09-10-2012, 15:29
lillen1337
This message has been deleted by YamiKaitou. Reason: spam
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 09-10-2012 , 16:17   Re: Error 052: Multi-dimensional arrays must be fully initialized
Reply With Quote #6

Quote:
Originally Posted by SkatInfinity View Post
I've got more errors when i did that.
post your whole code.
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-10-2012 , 19:40   Re: Error 052: Multi-dimensional arrays must be fully initialized
Reply With Quote #7

Dimensions cannot be variables. They must be constants.
__________________
fysiks is offline
SkatInfinity
Junior Member
Join Date: Sep 2012
Old 09-11-2012 , 01:41   Re: Error 052: Multi-dimensional arrays must be fully initialized
Reply With Quote #8

Here you go

Code:
/****************************
 * HnS: Cash Mod - V0.0.8
 * by ReCon aka NiQu
 * 
 * Based Of Version: 0.0.7
 * 
 * Do not try to add items/abilities/skills without
 * the knowledge of how to do it.
 *
 * Original ^2HerrCashMod Made by Herr | Lille^3
 *
 *
 * Thanks to TandborsteN for laserbeam.
 ****************************/

native add_user_immune( iPlayer );
native remove_user_immune( iPlayer );

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <engine>
#include <fakemeta>
#include <nvault>

#define PLUGIN "HnS: Cash Mod"
#define VERSION "0.0.7"
#define AUTHOR "ReCon"
#define PREFIX "CashMod"

#define XTRA_OFS_PLAYER            5
#define m_flNextAttack            83
#define m_afButtonPressed        246
#define m_iFOV                    363

const MAX_CLIENTS = 33;

new g_first_time[33];

enum _:g_iWeapCount
{
	WEAPON_FS,
	WEAPON_DEAGLE,
	WEAPON_AWP,
	WEAPON_SHOTGUN,
	SPACE,
	HE_GRENADE,
	SPACE,
	BULLET_FS,
	BULLET_DEAGLE,
	BULLET_AWP,
	BULLET_SHOTGUN,
         WEAPON_M4A1,
         BULLET_M4A1 }	
new const g_iWeapons [g_iWeapCount] [] =
{        "Five Seven",
	"Deagle",
	"AWP",
	"SHOTGUN",
	"M4A1",
	"",
	"HE Grenade",
	"",
	"Five Seven Bullet",
	"Deagle Bullet",
	"AWP Bullet",
	"SHOTGUN Bullet",
         "M4A1 Bullet"	
};
new const g_iFirstWCost[g_iWeapCount] =
{
	2000, //Cost of first level of Five Seven
	3500, //Cost of first level of Deagle
	8000, //Cost of first level of AWP
	6500, //Cost of first level of M3
	4000, //cost of first level of M4A1
	1,
	400, //Cost of first level of HE Grenade
	1,
	2500, //Cost of first level of Five Seven Bullet
	4000, //Cost of first level of Deagle Bullet
	8500, //Cost of first level of AWP Bullet
	7000, //Cost of first level of M3 Bullet
         4500 //Cost of first level of M4A1 Bullet
}

new const g_iWeapShort [g_iWeapCount] [] =
{
	"%",
	"%",
	"%",
	"%",
	"%",
	"%",
	"Bullets",
	"Bullets",
	"Bullets",
	"Bullets",
	"Bullets"	
}
new const g_iWeapMaxVal[g_iWeapCount] =
{
	60,
	60,
	25,
	25,
	1,
	80,
	1,
	3,
	3,
	2,
	2
}

new g_iWeapMaxLevel[g_iWeapCount] =
{
	6,
	6,
	5,
	6,
	1,
	8,
	1,
	3,
	3,
	2,
	2
}

new g_iWeapClass [g_iWeapCount] =
{
	CSW_FIVESEVEN,
	CSW_DEAGLE,
	CSW_AWP,
	CSW_M3,
	CSW_M4A1, 
	2, //Space,
	CSW_HEGRENADE,
	2, //Space,
	1, //Bullet,
	1, //Bullet,
	1, //Bullet,
	1, //Bullet	
}
new const g_iWeapName [g_iWeapCount] [] =
{
	"weapon_fiveseven",
	"weapon_deagle",
	"weapon_awp",
	"weapon_m3",
	"weapon_m4a1",
	"",
	"weapon_hegrenade",
	""
};
enum _:g_iItemCount
{
	HEALTH,
	ARMOR,
	RESPAWN_CHANCE,
	FALL_DMG_REDUCE,
	STEALTH,
	FASTER_RUNNING,
	EXTRA_DAMAGE,
	NO_FOOTSTEPS,
	NO_FLASH,
	SCOPE,
	NO_PAIN,
	UNDER_COVER_SUITE,
	ANTI_FROSTNADE,
	Laserbeam,
	Heatseek_HE
}

new const g_iItems[g_iItemCount][] =
{
	"Extra Health",
	"Extra Armor",
	"Respawn Chance",
	"Fall Damage Reducer",
	"Stealth",
	"Faster Running",
	"Extra Damage",
	"No Footsteps",
	"No Flash",
	"Deagle Scope",
	"No Pain Shock",
	"Camofluage",
	"Anti-Frostnade",
	"LaserBeam",
	"Heeatseeking Grenade"
}

new const g_iFirstCost[g_iItemCount] =
{
	1000, //Cost of first level of Health
	750, //Cost of first level of Armor
	5000, //Cost of first level of Respawn Chance
	1500, //Cost of first level of Fall Damage Reducer
	5000, //Cost of first level of Stealth
	3000, //Cost of first level of Faster Running
	3000, //Cost of first level of Extra Damage
	1500, //Cost of No Footsteps
	20000, //Cost of No Flash
	10000, //Cost of Deagle Scope
	30000, //Cost of No Pain Shock
	45000, //Cost of Camofluage
	40000, //Cost of Anti Frostnade
	15000, //Cost of first level of LaserBeam
	25000 //Cost of Heatseeking Grenade
}

new const g_iItemShort[g_iItemCount][] =
{
	" HP",
	" AP",
	"%",
	"%",
	"%",
	"%",
	" DMG",
	"CT Only",
	"CT Only",
	"CT & T",
	"CT & T",
	"%",
	"CT & T",
	"CT & T",
	"CT & T"
}

new const g_iItemMaxVal[g_iItemCount] =
{
	150,
	150,
	60,
	50,
	60,
	8,
	45,
	1,
	1,
	1,
	1,
	1,
	1,
	3,
	1
}

new const g_iItemMaxLevel[g_iItemCount] =
{
	6,
	6,
	6,
	5,
	6,
	4,
	5,
	1,
	1,
	1,
	1,
	1,
	1,
	3,
	1
}

new g_iCash[MAX_CLIENTS + 1];
new g_iItemLevel[MAX_CLIENTS + 1][g_iItemCount];
new g_iWeapLevel[MAX_CLIENTS + 1][g_iWeapCount];
new g_iAuthID[33][36];
new bool:g_iRevivedOnce[32];
new Float:g_gametime;
new Float:g_gametime2;
new grenade[32];
new bool:g_track[33];
new bool:g_track_enemy;
new g_vault;
new g_msgScreenFade;
new g_sync_check_data;
new last;
new g_Admin[33];
new g_LoggedIn[32];
new g_serverType;
new sLaserShooterUsed[32];
new sLaserNextUse[33];
new hook_to[33][3];
new const sShootSound[] = "weapons/rocketfire1.wav";
new beamsprite;
new bool:gHasHe[33];

public plugin_precache()
{
	beamsprite = precache_model("sprites/dot.spr");
	precache_sound( sShootSound );
}

public plugin_init() 
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	//Register Spawn
	RegisterHam( Ham_Spawn, "player", "FwdPlayerSpawn", 1 );
	
	//Open MainMenu
	new command[]			= "Cash_StartMenu";
	register_clcmd( "say /mm", command );
	register_clcmd( "say /cash", command );
	register_clcmd( "say /cashmod", command );
	register_clcmd( "say /hnsc", command );
	register_clcmd( "say /hnscash", command );
	
	//Register Death
	register_event( "DeathMsg", "Event_DeathMsg", "a" );
	
	//Register Round Start
	register_logevent( "eRound_start", 2, "1=Round_Start" );
	
	//Register Kill
	RegisterHam(Ham_Killed, "player", "FwdPlayerDeath", 1);
	
	//Register Take Damage
	RegisterHam(Ham_TakeDamage, "player", "FwdPlayerTakeDMG", 1);
	
	//Register PostThink for scope
	RegisterHam(Ham_Player_PostThink, "player", "Player_PostThink");
	
	//Register PreThink
	RegisterHam(Ham_Player_PreThink, "player", "Player_PreThink");
	
	//Register Weapon Switch
	register_event( "CurWeapon" , "fw_EvCurWeapon" , "be" , "1=1" );
	
	register_forward(FM_Think, "fwdThink", 0);
	
	//Get user screenfade
	g_msgScreenFade = get_user_msgid("ScreenFade");
	
	//Register ScreenFade
	register_event("ScreenFade", "eventFlash", "be", "4=255", "5=255", "6=255", "7>199");
	
	//Registers two different TextMSG
	register_event("TextMsg", "fire_in_the_hole", "b", "2&#Game_radio", "4&#Fire_in_the_hole");
	register_event("TextMsg", "fire_in_the_hole2", "b", "3&#Game_radio", "5&#Fire_in_the_hole");
	
	//Register when someone/something throws grenade
	register_event("99", "grenade_throw2", "b");
	
	//Register Commands
	register_concmd("cm_givecash", "CmdGiveCash", ADMIN_RCON, "<nick, #userid, authid> <cash>");
	register_concmd("cm_removecash", "CmdRemoveCash", ADMIN_RCON, "<nick, #userid, authid> <cash>");
	
	//Open nvault
	g_vault = nvault_open("cashmod_recon");
    
	if( g_vault == INVALID_HANDLE )
	{
		set_fail_state( "Error opening nVault" );
	}
}

public plugin_end()
{
	nvault_close(g_vault);
}

public plugin_natives()
{
	register_library("cashmod");
	
	register_native("cm_get_user_cash", "_get_cash");
	register_native("cm_set_user_cash", "_set_cash");
	register_native("cm_get_user_admin", "_get_user_admin");
	register_native("cm_save", "_save");
	register_native("cm_load", "_load");
	register_native("cm_first_time", "_first_time");
	register_native("cm_has_user_nofrost", "_has_user_nofrost");
}

public _has_user_nofrost(iPlugin, iParams)
{
	new client = get_param(1);
	if(g_iItemLevel[client][ANTI_FROSTNADE] != 0)
	{
		return true;
	}
	else{
		return false;
	}
	return PLUGIN_CONTINUE;	
}
public _get_health_level(iPlugin, iParams)
{
	return g_iItemLevel[get_param(1)][HEALTH];
}

public _first_time(iPlugin, iParams)
{
	return g_first_time[get_param(1)];
}

public _save(iPlugin, iParams)
{
	Save(get_param(1));
}

public _load(iPlugin, iParams)
{
	Load(get_param(1));
}

public _set_server_type(iPlugin, iParams)
{	
	g_serverType = max(0, get_param(1));
	return g_serverType;
}

public _get_server_type(iPlugin, iParams)
{
	return g_serverType;
}

public _set_cash(iPlugin, iParams)
{		
	new iPlayer = get_param(1);
	if( !iPlayer )
		return PLUGIN_CONTINUE;
	
	g_iCash[iPlayer] = max(0, get_param(2));
	return g_iCash[iPlayer];
}

public _get_cash(iPlugin, iParams)
{
	return g_iCash[get_param(1)];
}

public _set_user_status(iPlugin, iParams)
{
	new iPlayer = get_param(1);
	if( !iPlayer )
		return PLUGIN_CONTINUE;
		
	g_LoggedIn[iPlayer] = max(0, get_param(2));
	return g_LoggedIn[iPlayer];
}

public _get_user_status(iPlugin, iParams)
{
	return g_LoggedIn[get_param(1)];
}

public _get_user_admin(iPlugin, iParams)
{
	return g_Admin[get_param(1)];
}

public Player_PostThink(id)
{
	DoZoom2(id);
}

public fwdThink(entid)
{
	static szClassname[33];
	pev(entid, pev_classname, szClassname, 32);
	
	static szModel[23];
	pev(entid, pev_model, szModel, 22);
	
	if( equali(szClassname, "grenade", 0)
	&& equali(szModel, "models/w_hegrenade.mdl", 0) &&
	g_iItemLevel[pev(entid, pev_owner)][Heatseek_HE] >= 1)
	{
		static Float:vOrigin[3];
		pev(entid, pev_origin, vOrigin);
		
		set_pev(entid, pev_renderfx, kRenderFxGlowShell);
		set_pev(entid, pev_rendercolor, {148.0, 0.0, 211.0});
		set_pev(entid, pev_rendermode, kRenderNormal);
		set_pev(entid, pev_renderamt, 100);
		
		static player;
		player = 0;
		static Float:vClosest[3];
		vClosest = Float:{4096.0, 4096.0, 4096.0};
		while( (player = engfunc(EngFunc_FindEntityInSphere, player, vOrigin, 512.0)) )
		{
			if( !is_user_alive(player) )
			{
				continue;
			}
				
			pev(player, pev_classname, szClassname, 6);
			if( equali(szClassname, "player", 0) )
			{
				if( get_user_team(player) != get_user_team(pev(entid, pev_owner)) )
				{
					static Float:vOrigin2[3];
					pev(player, pev_origin, vOrigin2);
					
					static hitplayer;
					hitplayer = fnTraceLine(entid, vOrigin, vOrigin2);
					
					if( vector_distance(vOrigin, vOrigin2)
					<
					vector_distance(vOrigin, vClosest)
					&& hitplayer == player )
					{
						vClosest = vOrigin2;
					}
				}
			}
		}
		if( vClosest[0] != 4096.0 )
		{
			entity_set_follow_origin(entid, vClosest, 350.0);
		}
	}
}

fnTraceLine(ignoreEnt, const Float:vStart[3], const Float:vEnd[3], Float:vReturn[3]={0.0, 0.0, 0.0})
{
	engfunc(EngFunc_TraceLine, vStart, vEnd, ignoreEnt == -1 ? 1 : 0, ignoreEnt);
	
	new ent = global_get(glb_trace_ent);
	global_get(glb_trace_endpos, vReturn);

	return pev_valid(ent) ? ent : 0;
}

stock entity_set_follow_origin(entity, Float:Origin[3], Float:speed)
{
	if(!pev_valid(entity)) return 0;
	
	new Float:entity_origin[3];
	pev(entity, pev_origin, entity_origin);
	
	new Float:diff[3];
	diff[0] = Origin[0] - entity_origin[0];
	diff[1] = Origin[1] - entity_origin[1];
	diff[2] = Origin[2] - entity_origin[2];
	
	new Float:length = floatsqroot(floatpower(diff[0], 2.0) + floatpower(diff[1], 2.0) + floatpower(diff[2], 2.0));
	
	new Float:Velocity[3];
	Velocity[0] = diff[0] * (speed / length);
	Velocity[1] = diff[1] * (speed / length);
	Velocity[2] = diff[2] * (speed / length);
	
	set_pev(entity, pev_velocity, Velocity);
	
	return 1;
}

public Player_PreThink(id)
{
	new nbut = pev(id, pev_button);
	new obut = pev(id, pev_oldbuttons);
	if((nbut & IN_RELOAD) && !(obut & IN_RELOAD))
	{
		if( sLaserShooterUsed[id] != 0 && is_user_alive(id) && sLaserNextUse[id])
		{
			hook_to[id][0]=999999;
			new player, body;
			get_user_aiming(id, player, body);
			if(is_user_connected(id) && is_user_connected(player))
			{
				sLaserShooterUsed[id] -= 1;
					
				//Get Id's origin
				static origin1[3];
				get_user_origin(id,origin1);
				
				if(hook_to[id][0]==999999)
				{
					static origin2[3];
					get_user_origin(id,origin2,3);
					hook_to[id][0]=origin2[0];
					hook_to[id][1]=origin2[1];
					hook_to[id][2]=origin2[2];
				}
				//Create RED beam
				message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
				write_byte(1);		//TE_BEAMENTPOINT
				write_short(id);	// start entity
				write_coord(hook_to[id][0]);
				write_coord(hook_to[id][1]);
				write_coord(hook_to[id][2]);
				write_short(beamsprite);
				write_byte(1);		// framestart
				write_byte(1);		// framerate
				write_byte(2);		// life in 0.1's
				write_byte(40);		// width
				write_byte(0);		// noise
				write_byte(255);	// red
				write_byte(0);		// green
				write_byte(0);		// blue
				write_byte(200);	// brightness
				write_byte(40);		// speed
				message_end();
				new CurrentHealth[32];
				CurrentHealth[player] = get_user_health(player);
				new Randnum = random_num(45, 99);
				new TakenHealth = CurrentHealth[player] - Randnum;
				new AttackerName[33];
				get_user_name(id, AttackerName, 31);
				emit_sound( id, CHAN_BODY, sShootSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
				sLaserNextUse[id] = false;
				set_task(0.5, "tskLaserNextUse", 10000 + id);
				if(is_user_alive(player))
				{
					if( CurrentHealth[player] < Randnum)
					{
						new GivenFrags = get_user_frags(id) + 1;
						set_user_frags(id, GivenFrags);
						g_iCash[id] += 20;
						
						Print(id, "^x03 You have been given^x04 20^x03 Cash for killing^x04 '%s'^x03 with a^x04 Laserbeam!", player);
						Print(player, "^x01 You have been killed by %s with a laserbeam!", AttackerName);
						make_deathmsg(id, player, 0, "Laser Beam");
						user_silentkill(player);
					}
					else{
						set_user_health(player, TakenHealth);
						Print(player, "^x03 You have been hurted for^x04 %i HP^x03 from^x04 %s's^x03 Laserbeam!", Randnum, AttackerName);
						Print(id, "^x04 You have hurted %s for ^x04 %i HP", player, Randnum);
					}
				}
			}
		}
	}
}

public tskLaserNextUse(id)
{
	id -= 10000;
	
	sLaserNextUse[id] = true;
}

public client_authorized( iPlayer )
{
	get_user_authid(iPlayer, g_iAuthID[ iPlayer ] , charsmax( g_iAuthID[] ) );
	Load(iPlayer);
	
	if ( access(iPlayer, ADMIN_LEVEL_A) )
		g_Admin[iPlayer] = true;
}

public client_disconnect( iPlayer )
{	
	Save(iPlayer);
}

public Load(iPlayer)
{
	static data[256], timestamp;
	if( nvault_lookup(g_vault, g_iAuthID[iPlayer], data, sizeof(data) - 1, timestamp) )
	{
		ParseLoadData(iPlayer, data);
	}
	else
	{
		NewUser(iPlayer);
	}
}

public NewUser(iPlayer)
{
	g_first_time[iPlayer] = 1;
	
	g_iCash[iPlayer] = 200;
	
	for( new iItem = 0; iItem < g_iItemCount; iItem++ )
	{
		g_iItemLevel[iPlayer][iItem] = 0;
	}
	for( new iWeap = 0; iWeap < g_iWeapCount; iWeap++ )
	{
		g_iWeapLevel[iPlayer][iWeap] = 0;
	}
}

ParseLoadData(iPlayer, data[256])
{
	static num[6];
	strbreak(data, num, sizeof(num) - 1, data, sizeof(data) - 1);
	
	g_iCash[iPlayer] = str_to_num(num);
	
	for( new iItem = 0; iItem < g_iItemCount; iItem++ )
	{
		strbreak(data, num, sizeof(num) - 1, data, sizeof(data) - 1);
		g_iItemLevel[iPlayer][iItem] = clamp(str_to_num(num), 0, g_iItemMaxLevel[iItem]);
	}
	
	for( new iWeap = 0; iWeap < g_iWeapCount; iWeap++ )
	{
		strbreak(data, num, sizeof(num) - 1, data, sizeof(data) - 1);
		g_iWeapLevel[iPlayer][iWeap] = clamp(str_to_num(num), 0, g_iWeapMaxLevel[iWeap]);
	}
}

public Save(iPlayer)
{
	static data[256];
	new len = formatex(data, sizeof(data) - 1, "%i", g_iCash[iPlayer]);
	
	for( new iItem = 0; iItem < g_iItemCount; iItem++ )
	{
		len += formatex(data[len], sizeof(data) - len - 1, " %i", g_iItemLevel[iPlayer][iItem]);
	}
	
	for( new iWeap = 0; iWeap < g_iWeapCount; iWeap++ )
	{
		len += formatex(data[len], sizeof(data) - len - 1, " %i", g_iWeapLevel[iPlayer][iWeap]);
	}
	
	nvault_set(g_vault, g_iAuthID[ iPlayer ], data);
}

public fw_EvCurWeapon( iPlayer )
{
	//If player bought faster running
	if( g_iItemLevel[iPlayer][FASTER_RUNNING] >= 1 )
	{
		//Call a function to set speed
		Set_Speed(iPlayer);
	}
}

public FwdPlayerTakeDMG(iPlayer, inflictor, attacker, Float:damage, damagebits)
{
	//If player is alive and the damage is done by falling
	if(is_user_alive(iPlayer) && (damagebits & DMG_FALL) )
	{
		//If player is either ct or T
		new CsTeams:team = cs_get_user_team(iPlayer);
		if( team == CS_TEAM_CT || team == CS_TEAM_T ) 
		{	
			//Percentage Calculation
			new iPercent = g_iItemMaxVal[FALL_DMG_REDUCE] * g_iItemLevel[iPlayer][FALL_DMG_REDUCE] / g_iItemMaxLevel[FALL_DMG_REDUCE];
			
			//Fall Damage Reducer
			SetHamParamFloat(4, damage * (1.0 - (float(iPercent) / 100.0)));
		}
	}
	
	if( ( 1 <= attacker <= get_maxplayers() && iPlayer != attacker ) )
	{
		new Float:fMultiplier = g_iItemLevel[iPlayer][EXTRA_DAMAGE] * 0.10 + 1.0;
		SetHamParamFloat( 4, damage * fMultiplier );
	}
	
	if( g_iItemLevel[iPlayer][NO_PAIN] >= 1 )
	{
		set_pdata_float(iPlayer, 108, 1.0);
	}
	return HAM_HANDLED;
}

public FwdPlayerDeath(iPlayer, Killer, Shouldgib)
{
	//If the player hasnt already been respawned
	if( !g_iRevivedOnce[iPlayer] )
	{
		//If player is either ct or t
		new CsTeams:team = cs_get_user_team(iPlayer);
		if( team == CS_TEAM_T || team == CS_TEAM_CT )
		{
			//Percentage Calculation
			new iPercent = g_iItemMaxVal[RESPAWN_CHANCE] * g_iItemLevel[iPlayer][RESPAWN_CHANCE] / g_iItemMaxLevel[RESPAWN_CHANCE];
			
			//Percentage Usage
			if( random_num(1, 100) <= iPercent )
			{
				//Set respwan in 1 second
				set_task(1.0, "Task_Respawn", iPlayer);
			}
		}
	}
}

public Task_Respawn(iPlayer)
{
	//Respawn Player
	ExecuteHamB(Ham_CS_RoundRespawn, iPlayer);
	
	//Print to the player that he/she got respawned
	Print(iPlayer, "^x03You got respawned!");
	
	//Disable respawn until next round
	g_iRevivedOnce[iPlayer] = true;
}

public eRound_start()
{
	//Bunc of variables
	new iPlayers[32], iNum, iPid;
	
	//Get all players
	get_players( iPlayers, iNum, "a" );
	
	//Browse through all players
	for( new i; i < iNum; i++ )
	{
		iPid = iPlayers[i];
		
		//Enable respawn
		g_iRevivedOnce[iPid] = false;
	}
}


public Event_DeathMsg()
{
	//Get the killer
	new killer = read_data(1);
	
	//Get the victim + a variable
	new victim = read_data(2);
	new vic_name[128];
	new format_text[128];
	get_user_name(victim, vic_name, 127);
	
	
	//Make sure that the killer exists
	if( 1 <= killer <= get_maxplayers() )
	{
		//If victim is not killer
		if( victim != killer )
		{
			//If victim is not a teammate of killer
			if( cs_get_user_team( victim ) != cs_get_user_team( killer ) )
			{
				//If killer is still alive
				if( is_user_alive( killer ) )
				{
					//Add cash to the killer
					if( g_Admin[killer] && g_iCash[killer] < 99938 )
					{
						g_iCash[killer] += 60;
						formatex(format_text, sizeof(format_text) - 1, "^x03You recieved 60 cash for killing^x04 %s", vic_name);
					}
					else
					{
						g_iCash[killer] += 40;
						formatex(format_text, sizeof(format_text) - 1, "^x03You recieved 40 cash for killing^x04 %s", vic_name);
					}
					//Get the victims name
					get_user_name(victim, vic_name, 127);
					
					//Print out" to the player that he/she got cash
					Print(killer, format_text, vic_name);
				}
				
			}
			
		}
		
	}
	
}

public Cash_StartMenu(iPlayer)
{
	//Menu Title
	new title[512]; formatex(title, sizeof(title) - 1, "\r%s \w- \yMain Menu \w- \yBy \rReCon & TandborsteN ^nYour Cash: %i", PREFIX, g_iCash[iPlayer]);
	
	//Create the menu
	new menu = menu_create(title, "StartMenu_Handle");
	
	//Create Items Menu
	menu_additem(menu, "\wInfo", "1", 0);
	menu_additem(menu, "\wPlayer Info", "2", 0);
	menu_addblank(menu, 0);
	menu_additem(menu, "\wWeapon Shop", "3", 0);
	menu_additem(menu, "\wItem Shop", "4", 0);
	menu_addblank(menu, 1);
	menu_addblank(menu, 1);
	menu_addblank(menu, 1);
	
	//Display the menu
	menu_display(iPlayer, menu, 0);
}

public StartMenu_Handle(iPlayer, menu, item)
{
	if( item == MENU_EXIT )
	{
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	
	new data[6], iName[64];
	new access, callback;
	
	menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
	
	new key = str_to_num(data);
	switch(key)
	{
		case 1:
		{
			show_motd(iPlayer, "cashmod/info.motd", "CashMod Info");
		}
		case 2:
		{
			Cash_PlayerMenu(iPlayer);
		}
		case 3:
		{
			Cash_WeaponMenu(iPlayer);
		}
		case 4:
		{
			Cash_MainMenu(iPlayer);
		}
	}
	return PLUGIN_HANDLED;
}

public Cash_PlayerMenu(iPlayer)
{
	new title[170]; formatex(title, sizeof(title) - 1, "\r%s - \w \yPlayer Menu", PREFIX);
	new menu = menu_create(title, "Cash_PlayerHandle");
	
	new players[32], pnum, tempid;
	new szName[32], szTempid[10];
    
	get_players(players, pnum);
	
	for( new i; i<pnum; i++ )
	{
		tempid = players[i];
		
		get_user_name(tempid, szName, 31);
		num_to_str(tempid, szTempid, 9);
		
		menu_additem(menu, szName, szTempid, 0);
	}
	
	menu_display(iPlayer, menu, 0);
}

public Cash_PlayerHandle(iPlayer, menu, item)
{
	if( item == MENU_EXIT )
	{
		menu_destroy(menu);
		Cash_StartMenu(iPlayer);
		return PLUGIN_HANDLED;
	}
	
	new data[6], iName[64];
	new access, callback;
	menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
	
	new tempid = str_to_num(data);
	new tempname[32]; get_user_name(tempid, tempname, 31);
	
	static motd[2500];
	new len = formatex(motd, sizeof(motd) - 1,	"<html>");
	len += format(motd[len], sizeof(motd) - len - 1,	"<body style=^"background-color:#030303; color:#FF8F00^">");
	len += format(motd[len], sizeof(motd) - len - 1,	"<p align=^"center^">");
	len += format(motd[len], sizeof(motd) - len - 1,	"Player Info for %s.<br><br>", tempname);
	len += format(motd[len], sizeof(motd) - len - 1,	"Player Cash: %i.<br><br>", g_iCash[tempid]);
	len += format(motd[len], sizeof(motd) - len - 1,	"<b>Weapon Chance</b>:<br>");
	for( new iWeap = 0; iWeap < g_iWeapCount; iWeap++ )
	{
		if( g_iWeapClass[iWeap] != 2 )
		{
			len += format(motd[len], sizeof(motd) - len - 1,	"%s  -  Level: %i/%i <br>", g_iWeapons[iWeap], g_iWeapLevel[tempid][iWeap], g_iWeapMaxLevel[iWeap]);
		}
	}
	
	len += format(motd[len], sizeof(motd) - len - 1,	"<br><br><b>Other Items:</b><br>");
	for( new iItem = 0; iItem < g_iItemCount; iItem++ )
	{
		len += format(motd[len], sizeof(motd) - len - 1,	"%s  -  Level: %i/%i <br>", g_iItems[iItem], g_iItemLevel[tempid][iItem], g_iItemMaxLevel[iItem]);
	}
	len += format(motd[len], sizeof(motd) - len - 1,	"</p>");
	len += format(motd[len], sizeof(motd) - len - 1,	"</body>");
	len += format(motd[len], sizeof(motd) - len - 1,	"</html>");
	
	show_motd(iPlayer, motd, "Player Info");
	
	menu_destroy(menu);
	return PLUGIN_HANDLED;
}

public Cash_WeaponMenu(iPlayer)
{
	//Menu Title
	new title[170]; formatex(title, sizeof(title) - 1, "\r%s \w- \yWeapon Menu \w- \yBy \rReCon ^nYour Cash: %i", PREFIX, g_iCash[iPlayer]);
	
	//Create the menu
	new menu = menu_create(title, "WeaponMenu_Handle");
	new iNumber[5], iCost, szOption[80], Amount, Level, Level2;
	
	
	//Browse through all menu items
	for( new iWeap = 0; iWeap < g_iWeapCount; iWeap++ )
	{
		//Bunch of variables
		num_to_str(iWeap, iNumber, 4);
		Level = g_iWeapLevel[iPlayer][iWeap];
		Level2 = g_iWeapLevel[iPlayer][iWeap] + 1;
		iCost = g_iFirstWCost[iWeap] * (1 << (Level2 - 1));
		Amount = g_iWeapMaxVal[iWeap] * g_iWeapLevel[iPlayer][iWeap] / g_iWeapMaxLevel[iWeap];
		
		//If the player already have maxlevel
		if( g_iWeapLevel[iPlayer][iWeap] >= g_iWeapMaxLevel[iWeap] )
		{
			if( g_iWeapClass[iWeap] == 2 )
			{
				formatex(szOption, 79, "");
			}
			else
			{
				formatex(szOption, 79, "\y%s: \wLevel %i \r(%i%s)", g_iWeapons[iWeap], Level, Amount, g_iWeapShort[iWeap]);
			}
		}
		//If the player cant afford the item
		else if( g_iCash[iPlayer] < iCost )
		{
			if( g_iWeapClass[iWeap] == 2 )
			{
				formatex(szOption, 79, "");
			}
			else
			{
				formatex(szOption, 79, "\d%s: \wLevel %i \r(%i%s) \y%i Cash", g_iWeapons[iWeap], Level, Amount, g_iWeapShort[iWeap], iCost);
			}
		}
		//If the player has not maxed out the item
		else if( g_iWeapLevel[iPlayer][iWeap] < g_iWeapMaxLevel[iWeap] )
		{
			if( g_iWeapClass[iWeap] == 2 )
			{
				formatex(szOption, 79, "");
			}
			else
			{
				formatex(szOption, 79, "\r%s: \wLevel %i \r(%i%s) \y%i Cash", g_iWeapons[iWeap], Level, Amount, g_iWeapShort[iWeap], iCost);
			}
		}
		
		//Add all the menu items
		if( g_iWeapClass[iWeap] == 2 )
		{
			menu_addblank(menu, 0);
		}
		else
		{
			menu_additem(menu, szOption, iNumber);
		}
	}
	
	//Display the menu
	menu_display(iPlayer, menu, 0);
}

public WeaponMenu_Handle(iPlayer, menu, item)
{
	//Get the menu data
	if( item == MENU_EXIT )
	{
		menu_destroy(menu);
		Cash_StartMenu(iPlayer);
		return PLUGIN_HANDLED;
	}
	
	//Bunc of variables
	new data[6], iName[64];
	new access, callback;
	menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
	
	new iWeap = str_to_num( data ), iCost, Level;
	Level = g_iWeapLevel[iPlayer][iWeap] + 1;
	iCost = g_iFirstWCost[iWeap] * (1 << (Level - 1));
	
	if( iWeap == BULLET_FS && g_iWeapLevel[iPlayer][WEAPON_FS] <= 0 || iWeap == BULLET_DEAGLE && g_iWeapLevel[iPlayer][WEAPON_DEAGLE] <= 0 || iWeap == BULLET_AWP && g_iWeapLevel[iPlayer][WEAPON_AWP] <= 0  || iWeap == BULLET_M4A1 && g_iWeapLevel[iPlayer][WEAPON_M4A1] <= 0 )
	{
		Print(iPlayer, "^x03You don't have this weapons!");
		Cash_WeaponMenu(iPlayer);
		return PLUGIN_HANDLED;
	}
	
	//If player has maxed out the item
	if( g_iWeapLevel[iPlayer][iWeap] == g_iWeapMaxLevel[iWeap] )
	{
		Print(iPlayer, "^x03You have the max level of %s!", g_iWeapons[iWeap]);
	}
	//If the player cant afford the item
	else if( g_iCash[iPlayer] < iCost )
	{
		Print(iPlayer, "^x03You dont have enough cash to buy %s Level: %i", g_iWeapons[iWeap], Level);
	}
	//Take Cash, Print and give level
	else
	{
		//Take cash
		g_iCash[iPlayer] -= iCost;
		
		//Give a level
		g_iWeapLevel[iPlayer][iWeap] += 1;
		
		//Print out to the player that he/she bought an item with corresponding level
		Print(iPlayer, "^x03You bought %s Level: %i", g_iWeapons[iWeap], Level);
	}
	
	Cash_WeaponMenu(iPlayer);
	return PLUGIN_HANDLED;
}

public Cash_MainMenu(iPlayer)
{
	//Menu Title
	new title[70]; formatex(title, sizeof(title) - 1, "\r%s \w- \yMain Menu \w- \yBy \rReCon^nYour Cash: %i", PREFIX, g_iCash[iPlayer]);
	
	//Create the menu
	new menu = menu_create(title, "MainMenu_Handle");
	new iNumber[5], iCost, szOption[80], Amount, Level, Level2;
	
	
	//Browse through all menu items
	for( new iItem = 0; iItem < g_iItemCount; iItem++ )
	{
		//Bunch of variables
		num_to_str(iItem, iNumber, 4);
		Level = g_iItemLevel[iPlayer][iItem];
		Level2 = g_iItemLevel[iPlayer][iItem] + 1;
		iCost = g_iFirstCost[iItem] * (1 << (Level2 - 1));
		Amount = g_iItemMaxVal[iItem] * g_iItemLevel[iPlayer][iItem] / g_iItemMaxLevel[iItem];
		
		if( iItem == EXTRA_DAMAGE && g_serverType == 1 )
		{
			return PLUGIN_CONTINUE;
		}
		
		//If the player already have maxlevel
		if( g_iItemLevel[iPlayer][iItem] >= g_iItemMaxLevel[iItem] )
		{
			if( iItem == NO_FOOTSTEPS || iItem == NO_FLASH || iItem == SCOPE || iItem == NO_PAIN || iItem == ANTI_FROSTNADE || iItem == Laserbeam )
			{
				formatex(szOption, 79, "\y%s: \dLevel %i \r(%s)", g_iItems[iItem], Level, g_iItemShort[iItem]);
			}
			else
			{
				formatex(szOption, 79, "\y%s: \dLevel %i \r(%i%s)", g_iItems[iItem], Level, Amount, g_iItemShort[iItem]);
			}
		}
		//If the player cant afford the item
		else if( g_iCash[iPlayer] < iCost )
		{
			if( iItem == NO_FOOTSTEPS || iItem == NO_FLASH || iItem == SCOPE || iItem == NO_PAIN || iItem == ANTI_FROSTNADE || iItem == Laserbeam )
			{
				formatex(szOption, 79, "\d%s: \wLevel %i \r(%s) \y%i Cash", g_iItems[iItem], Level, g_iItemShort[iItem], iCost);
			}
			else
			{
				formatex(szOption, 79, "\d%s: \wLevel %i \r(%i%s) \y%i Cash", g_iItems[iItem], Level, Amount, g_iItemShort[iItem], iCost);
			}
		}
		//If the player has not maxed out the item
		else if( g_iItemLevel[iPlayer][iItem] < g_iItemMaxLevel[iItem] )
		{
			if( iItem == NO_FOOTSTEPS || iItem == NO_FLASH || iItem == SCOPE || iItem == NO_PAIN || iItem == ANTI_FROSTNADE || iItem == Laserbeam )
			{
				formatex(szOption, 79, "\r%s: \wLevel %i \r(%s) \y%i Cash", g_iItems[iItem], Level, g_iItemShort[iItem], iCost);
			}
			else
			{
				formatex(szOption, 79, "\r%s: \wLevel %i \r(%i%s) \y%i Cash", g_iItems[iItem], Level, Amount, g_iItemShort[iItem], iCost);
			}
		}
		
		//Add all the menu items
		menu_additem(menu, szOption, iNumber);
	}
	
	//Display the menu
	menu_display(iPlayer, menu, 0);
	
	return PLUGIN_HANDLED;
}

public MainMenu_Handle(iPlayer, menu, item)
{
	//Get the menu data
	if( item == MENU_EXIT )
	{
		menu_destroy(menu);
		Cash_StartMenu(iPlayer);
		return PLUGIN_HANDLED;
	}
	
	//Bunc of variables
	new data[6], iName[64];
	new access, callback;
	menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
	
	new iItem = str_to_num( data ), iCost, Level;
	Level = g_iItemLevel[iPlayer][iItem] + 1;
	iCost = g_iFirstCost[iItem] * (1 << (Level - 1));
	
	//If player has maxed out the item
	if( g_iItemLevel[iPlayer][iItem] == g_iItemMaxLevel[iItem] )
	{
		Print(iPlayer, "^x03You have the max level of %s!", g_iItems[iItem]);
	}
	//If the player cant afford the item
	else if( g_iCash[iPlayer] < iCost )
	{
		Print(iPlayer, "^x03You dont have enough cash to buy %s Level: %i", g_iItems[iItem], Level);
	}
	//Take Cash, Print and give level
	else
	{
		//Take cash
		g_iCash[iPlayer] -= iCost;
		
		//Give a level
		g_iItemLevel[iPlayer][iItem] += 1;
		
		//Print out to the player that he/she bought an item with corresponding level
		Print(iPlayer, "^x03You bought %s Level: %i", g_iItems[iItem], Level);
	}
	
	Cash_MainMenu(iPlayer);
	return PLUGIN_HANDLED;
}

public FwdPlayerSpawn(iPlayer)
{
	//If player is alive when spawned
	if( is_user_alive(iPlayer) )
	{

			//If player has bought extra health
			if( g_iItemLevel[iPlayer][HEALTH] >= 1 )
			{
				//Set health to its self and add the extra health
				set_user_health(iPlayer, get_user_health(iPlayer) + g_iItemMaxVal[HEALTH] * g_iItemLevel[iPlayer][HEALTH] / g_iItemMaxLevel[HEALTH]);
			}
			//If player has bought extra armor
			if( g_iItemLevel[iPlayer][ARMOR] >= 1 )
			{
				//Set armor to its self and add the extra armor
				set_user_armor(iPlayer, g_iItemMaxVal[ARMOR] * g_iItemLevel[iPlayer][ARMOR] / g_iItemMaxLevel[ARMOR]);
			}
			//If player has bought stealth
			if( g_iItemLevel[iPlayer][STEALTH] >= 1 )
			{
				//Call a function to set stealth
				Set_Stealth(iPlayer);
				
			}
			//If player has bought faster running
			if( g_iItemLevel[iPlayer][FASTER_RUNNING] >= 1 )
			{
				//Call a function to set speed
				Set_Speed(iPlayer);
			}
			//If player has bought no footsteps
			if( g_iItemLevel[iPlayer][NO_FOOTSTEPS] >= 1 )
			{
				set_user_footsteps(iPlayer, 1);
			}
			//If player has bought undercover suite
			if( g_iItemLevel[iPlayer][UNDER_COVER_SUITE] >= 1 )
			{
				remove_task(iPlayer);
				set_task(9.0, "Set_Undercover", iPlayer);
			}
			//If player has bought Antifrost nade
			if( g_iItemLevel[iPlayer][ANTI_FROSTNADE] >= 1 )
			{
				add_user_immune(iPlayer)
			}
			else
			{
				remove_user_immune(iPlayer);
			}
			//If player has bought Laserbeam
			if( g_iItemLevel[iPlayer][Laserbeam] >= 1 )
			{
				sLaserShooterUsed[iPlayer] = g_iItemLevel[iPlayer][Laserbeam];
				sLaserNextUse[iPlayer] = true;
			}
			
			//Give weapons, the check if the player bought is in the function
			remove_task(iPlayer);
			set_task(10.0, "Set_Weapons", iPlayer);
	}
}

public Set_Undercover(iPlayer)
{
	//Percentage Calculation
	new iPercent = g_iItemMaxVal[UNDER_COVER_SUITE] * g_iItemLevel[iPlayer][UNDER_COVER_SUITE] / g_iItemMaxLevel[UNDER_COVER_SUITE];
	
	//Get Players Team
	new CsTeams:team = cs_get_user_team(iPlayer);
	
	//Percentage Usage
	if( random_num(1, 100) <= iPercent )
	{
		//If player is alive
		if( is_user_alive(iPlayer) )
			{
			if(team == CS_TEAM_CT)
			{
				cs_set_user_model(iPlayer, "leet");
				Print(iPlayer, "^x03You  look like a Terrorist");
			}
			else if(team == CS_TEAM_T)
			{
				cs_set_user_model(iPlayer, "gign");
				Print(iPlayer, "^x03You look like a Counter-Terrorist!");
			}
		}
	}
}

public Set_Stealth(iPlayer)
{		
	new StealthAmt = g_iItemLevel[iPlayer][STEALTH] * 25;
	new NewStealth = 255 - StealthAmt;
			
	set_user_rendering( iPlayer, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, NewStealth );
}

public Set_Speed(iPlayer)
{
	//Percentage Calculation
	new iPercent = g_iItemMaxVal[FASTER_RUNNING] * g_iItemLevel[iPlayer][FASTER_RUNNING] / g_iItemMaxLevel[FASTER_RUNNING];
	
	//Speed Calculation
	new iSpeed = iPercent * 250 / 100;
	
	//Set Speed
	set_user_maxspeed(iPlayer, 250.0 + iSpeed);
}

public calc_value(const level, const max_level, const max_value)
{
	return (max_value * level / max_level);
}

public Set_Weapons(iPlayer)
{
	//Browse through all menu items
	new iNumber[5];
	for( new iWeap = 0; iWeap < g_iWeapCount; iWeap++ )
	{
		//Bunch of variables
		num_to_str(iWeap, iNumber, 4);
		
		//Bullets
		new iBullets;
		
		if( iWeap == WEAPON_FS && g_iWeapLevel[iPlayer][BULLET_FS] >= 1 )
		{
			iBullets = g_iWeapLevel[iPlayer][BULLET_FS] + 1;
		}
		else if( iWeap == WEAPON_DEAGLE && g_iWeapLevel[iPlayer][BULLET_DEAGLE] >= 1 )
		{
			iBullets = g_iWeapLevel[iPlayer][BULLET_DEAGLE] + 1;
		}
		else if( iWeap == WEAPON_AWP && g_iWeapLevel[iPlayer][BULLET_AWP] >= 1 )
		{
			iBullets = g_iWeapLevel[iPlayer][BULLET_AWP] + 1;	
		}
		else if ( iWeap == WEAPON_SHOTGUN && g_iWeapLevel[iPlayer][BULLET_SHOTGUN] >= 1 )
	         {
			iBullets = g_iWeapLevel[iPlayer][BULLET_SHOTGUN] +1;
	         }
                  else if ( iWeap == WEAPON_M4A1 && g_iWeapLevel[iPlayer][BULLET_M4A1] >= 1 )
		{
			iBullets = g_iWeapLevel[iPlayer][BULLET_M4A1] + 1;	
		}
		if( iBullets == 0 )
		{
			iBullets = 1;
		}
		
		if( g_iWeapLevel[iPlayer][iWeap] >= 1 )
		{
			static percent;
			percent = calc_value(g_iWeapLevel[iPlayer][iWeap], g_iWeapMaxLevel[iWeap], g_iWeapMaxVal[iWeap]);
			
			//new Chance = g_iWeapLevel[iPlayer][iWeap] * g_iWeapMaxVal[iWeap];
			//new randonnumb = random_num(1, 100);
			
			new message[72];
			
			if(is_user_connected(iPlayer))
			{
				if( percent > 0 && (percent == 100 || random_num(1, 100) <= percent ) )
				{
					if( iWeap == HE_GRENADE && !user_has_weapon(iPlayer, g_iWeapClass[HE_GRENADE]) )
					{	
						give_item(iPlayer, g_iWeapName[HE_GRENADE]);
						formatex(message, sizeof(message) - 1, "^x03You recieved a HE Grenade ^x04[%i%%%%].", percent);
						
						if(g_iItemLevel[iPlayer][Heatseek_HE] >= 1)
						{
							gHasHe[iPlayer] = true;
						}
					}
					else
					{
						give_item(iPlayer, g_iWeapName[iWeap]);
						cs_set_weapon_ammo(find_ent_by_owner(iPlayer, g_iWeapName[iWeap], iPlayer), iBullets);
						cs_set_user_bpammo(iPlayer, g_iWeapClass[iWeap], 0);
						formatex(message, sizeof(message) - 1, "^x03You recieved a %s with %i bullets ^x04[%i%%%%].", g_iWeapons[iWeap], iBullets, percent);
					}
					Print(iPlayer, message);
				}
			}
		}
	}
	return PLUGIN_HANDLED;
}

//The following functions are used to give and remove, dont touch!
public CmdGiveCash(iPlayer, level, cid)
{
	if( !cmd_access(iPlayer, level, cid, 3) ) return PLUGIN_HANDLED;
	
	static arg[35];
	read_argv(1, arg, sizeof(arg) - 1);
	
	new target = cmd_target(iPlayer, arg, CMDTARGET_NO_BOTS);
	if( !target ) return PLUGIN_HANDLED;
	
	read_argv(2, arg, sizeof(arg) - 1);
	new CASH = str_to_num(arg);
	
	if( CASH <= 0 )
	{
		console_print(iPlayer, "Not enough cash!");
		if( CASH < 0 )
		{
			console_print(iPlayer, "Use cm_removecash instead!");
		}
		return PLUGIN_HANDLED;
	}
	
	if( CASH >= 99999 )
	{
		console_print(iPlayer, "To much cash!");
		return PLUGIN_HANDLED;
	}
	
	g_iCash[target] += CASH;
	
	static name[2][32];
	get_user_name(iPlayer, name[0], sizeof(name[]) - 1);
	get_user_name(target, name[1], sizeof(name[]) - 1);
	
	client_print(iPlayer, print_console, "%s You gave %s %i cash!", PREFIX, name[1], CASH);
	
	static steamid[2][35];
	get_user_authid(iPlayer, steamid[0], sizeof(steamid[]) - 1);
	get_user_authid(target, steamid[1], sizeof(steamid[]) - 1);
	
	log_amx("%s (%s) gave %i XP to %s (%s)", name[0], steamid[0], CASH, name[1], steamid[1]);
	
	return PLUGIN_HANDLED;
}

public CmdRemoveCash(iPlayer, level, cid)
{
	if ( !cmd_access(iPlayer, level, cid, 3) ) return PLUGIN_HANDLED;
	
	static arg[35];
	read_argv(1, arg, sizeof(arg) - 1);
	
	new target = cmd_target(iPlayer, arg, CMDTARGET_OBEY_IMMUNITY|CMDTARGET_NO_BOTS|CMDTARGET_ALLOW_SELF);
	if( !target ) return PLUGIN_HANDLED;
	
	read_argv(2, arg, sizeof(arg) - 1);
	new Cash = str_to_num(arg);
	
	if ( Cash <= 0 ) return PLUGIN_HANDLED;
	g_iCash[target] -= Cash;
	
	new t_name[60];
	get_user_name(target, t_name, 59);

	client_print(iPlayer, print_console, "%s You removed %i cash from %s!", PREFIX, Cash, t_name);
	
	return PLUGIN_CONTINUE;
}

public bad_fix2() {
	new Float:gametime = get_gametime();
	if(gametime - g_gametime2 > 2.5)
		for(new i = 0; i < 32; i++)
			grenade[i] = 0;
}

public eventFlash( id ) {
	new Float:gametime = get_gametime();
	if(gametime != g_gametime) { 
		g_gametime = gametime;
		for(new i = 0; i < 33; i++) 
			g_track[i] = false;
		g_track_enemy = false;
	}    
	if(g_iItemLevel[id][NO_FLASH] >= 1) {
		g_track_enemy = true;

		message_begin(MSG_ONE, g_msgScreenFade, {0,0,0}, id);
		write_short(1);
		write_short(1);
		write_short(1);
		write_byte(0);
		write_byte(0);
		write_byte(0);
		write_byte(255);
		message_end();
	}
}

public flash_delay() {
	if(g_track_enemy == false) {
		for(new i = 0; i < 33; i++) {
			if(g_track[i] == true && is_user_connected(i)) {
				message_begin(MSG_ONE, g_msgScreenFade, {0,0,0}, i) ;
				write_short(1);
				write_short(1);
				write_short(1);
				write_byte(0);
				write_byte(0);
				write_byte(0);
				write_byte(255);
				message_end();
			}
		}
	}
}

public grenade_throw2() {
	if(g_sync_check_data == 0)
		return PLUGIN_CONTINUE;
	g_sync_check_data--;
	if(read_datanum() < 2)
		return PLUGIN_HANDLED_MAIN;

	if(read_data(1) == 11 && (read_data(2) == 0 || read_data(2) == 1))
		add_grenade_owner(last);

	return PLUGIN_CONTINUE;
}

public fire_in_the_hole() {
	new name[32];
	read_data(3, name, 31);
	new temp_last = get_user_index(name);
	new junk;
	if((temp_last == 0) || (!is_user_connected(temp_last)))
		return PLUGIN_CONTINUE;
	if(get_user_weapon(temp_last,junk,junk) == CSW_FLASHBANG) {
		last = temp_last;
		g_sync_check_data = 2; 
	}
	return PLUGIN_CONTINUE;
}

public fire_in_the_hole2() {
	new name[32];
	read_data(4, name, 31);
	new temp_last = get_user_index(name);
	new junk;
	if((temp_last == 0) || (!is_user_connected(temp_last)))
		return PLUGIN_CONTINUE;
	if(get_user_weapon(temp_last,junk,junk) == CSW_FLASHBANG) {    
		last = temp_last;
		g_sync_check_data = 2;
	}
	return PLUGIN_CONTINUE;
}

public add_grenade_owner(owner)
{
	new Float:gametime = get_gametime();
	g_gametime2 = gametime;
	for(new i = 0; i < 32; i++)
	{
		if(grenade[i] == 0)
		{
			grenade[i] = owner;
			return;
		}
	}
}

// from XxAvalanchexX "Flashbang Dynamic Light"
public fw_emitsound(entity,channel,const sample[],Float:volume,Float:attenuation,fFlags,pitch) {
	if(!equali(sample,"weapons/flashbang-1.wav") && !equali(sample,"weapons/flashbang-2.wav"))
		return FMRES_IGNORED;

	new Float:gametime = get_gametime();

	//in case no one got flashed, the sound happens after all the flashes, same game time
	if(gametime != g_gametime) {
		return FMRES_IGNORED;
	}
	return FMRES_IGNORED;
}
// NoFlash Blinding - End

public DoZoom2(id)
{
	
	if(	!is_user_alive(id)
	||	get_pdata_float(id, m_flNextAttack, XTRA_OFS_PLAYER) >= 0.0
	||	~get_pdata_int(id, m_afButtonPressed, XTRA_OFS_PLAYER) & IN_ATTACK2
	&&	g_iItemLevel[id][SCOPE] <= 0 )
	{
		return 0;
	}
	else if(pev(id,pev_button) & IN_ATTACK2 && get_user_weapon(id) == CSW_DEAGLE && g_iItemLevel[id][SCOPE] >= 1)
	{
		
		new iFov
		switch( get_pdata_int(id, m_iFOV, XTRA_OFS_PLAYER) )
		{
			case 40:iFov = 15
			case 15:iFov = 0
			default:iFov = 40
		}
	
		set_pev(id, pev_fov, iFov)
		set_pdata_int(id, m_iFOV, iFov, XTRA_OFS_PLAYER)
		
		set_pdata_float(id, m_flNextAttack, 0.25)
		emit_sound(id, CHAN_ITEM, "weapons/zoom.wav", 0.20, 2.40, 0, 100)
	}
	return PLUGIN_CONTINUE;
}

Print(iPlayer, const sMsg[], any:...)
{
	static i; i = iPlayer ? iPlayer : get_Player();
	if ( !i ) return;
	
	new sMessage[256];
	new len = formatex(sMessage, sizeof(sMessage) - 1, "^x04%s ", PREFIX);
	vformat(sMessage[len], sizeof(sMessage) - 1 - len, sMsg, 3);
	sMessage[192] = '^0';
		
	static msgid_SayText;
	if ( !msgid_SayText ) msgid_SayText = get_user_msgid("SayText");
	
	new const team_Names[][] =
	{
		"",
		"TERRORIST",
		"CT",
		"SPECTATOR"
	};
		
	new sTeam = get_user_team(i);
	
	team_Info(i, iPlayer, team_Names[0]);
		
	message_begin(iPlayer ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, msgid_SayText, _, iPlayer);
	write_byte(i);
	write_string(sMessage);
	message_end();
		
	team_Info(i, iPlayer, team_Names[sTeam]);
}

team_Info(receiver, sender, sTeam[])
{
	static msgid_TeamInfo;
	if ( !msgid_TeamInfo ) msgid_TeamInfo = get_user_msgid("TeamInfo");
	
	message_begin(sender ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, msgid_TeamInfo, _, sender);
	write_byte(receiver);
	write_string(sTeam);
	message_end();
}

get_Player()
{
	for ( new iPlayer = 1; iPlayer <= get_maxplayers(); iPlayer++ )
	{
		return iPlayer;
	}
	
	return 0;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1053\\ f0\\ fs16 \n\\ par }
*/

Last edited by SkatInfinity; 09-11-2012 at 01:46.
SkatInfinity is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 09-11-2012 , 10:20   Re: Error 052: Multi-dimensional arrays must be fully initialized
Reply With Quote #9

Your g_iWeapShort array doesn't have all elements filled.
The same for all following arrays as well.
When you add enums to g_iWeapCount you need to add values to the all arrays that use it as well !

Also your g_iWeapCount's WEAPON_M4A1 enum is in the wrong place.
__________________
Hunter-Digital is offline
SkatInfinity
Junior Member
Join Date: Sep 2012
Old 09-11-2012 , 10:49   Re: Error 052: Multi-dimensional arrays must be fully initialized
Reply With Quote #10

Thank you, so much! I finally got it fixed!

Last edited by SkatInfinity; 09-11-2012 at 14:37.
SkatInfinity 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 16:11.


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