PDA

View Full Version : [HNS XP Mod] Help Adding Deagle and Awp Chance


Capell
06-27-2010, 07:16
Hey guys. I'm trying to add Deagle and Awp to HNS XP Mod by Exolent.

When you "win" a weapon it gives you 10 bullets(for awp) and 7 bullets(for deagle).
Code looks like this

new const g_weapons_classnames[Weapons][] =
{
"weapon_awp",
"weapon_deagle"
};
I tried making it this so you only get 1 bullet instead of 10 or 7 depending on the weapon.

new const g_weapons_classnames[Weapons][](client) =
{
cs_set_weapon_ammo( give_item(client, "weapon_awp"), 1);
cs_set_weapon_ammo( give_item(client, "weapon_deagle"), 1);
};
But then I get these errors when compiling.

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

D:\Users\Capell\Desktop\hns_xp.sma(142) : error 009: invalid array size (negative or zero)
D:\Users\Capell\Desktop\hns_xp.sma(146) : error 010: invalid function or declaration

2 Errors.
Could not locate output file D:\Users\Capell\Desktop\hns_xp.amx (compile failed).

Compilation Time: 0.62 sec


Anyone know how I can fix?^^ Please.

wrecked_
06-27-2010, 11:33
#define WEAPON_AMT 2

new const g_weapons[WEAPON_AMT][] =
{
"weapon_awp",
"weapon_deagle"
}

new const g_ammo[WEAPON_AMT] =
{
1, // awp
1 // deagle
}

// Usage
// Let's say he chose the deagle from a menu and choice holds the value 1.

cs_set_weapon_ammo( give_item( id, g_weapons[choice] ), g_ammo[choice] )

// He now has a deagle with 1 bullet.