PHP Code:
new const g_max_clip[] =
{
13, 10, 7, 30,
30, 30, 20, 25,
30, 35, 35, 25,
12, 20, 10, 30,
100, 8, 30, 30,
20, 7, 30, 30, 50
}
Poor and inconsistent form; consider separating them each to be on a different line or revise the other variables to be in a similar format to this. Also, inconsistent use of semicolons.
PHP Code:
for (new a = 0; a < sizeof (g_other_weapons); a++)
if (wpnindex == g_other_weapons[a])
return;
if (!csdm_get_ffa() && TK)
return;
Reorder these so that the second condition is first. The first loop is more expensive so it should be executed after the second.
PHP Code:
new ammo = get_weapon_maxclip(wpnindex);
if (!ammo)
return;
client_cmd(killer, "spk ^"items/9mmclip1.wav^"");
cs_set_weapon_ammo(weapon, ammo);
return;
This can be reordered to something like this:
PHP Code:
new ammo = get_weapon_maxclip(wpnindex);
if (ammo)
{
client_cmd(killer, "spk ^"items/9mmclip1.wav^"");
cs_set_weapon_ammo(weapon, ammo);
}
return;
PHP Code:
get_weaponname(wpnid, name, sizeof (name) - 1);
I suggest using charsize.
PHP Code:
stock get_weapon_maxclip(wpnid = 0)
// ...
stock fm_get_weapon_ent(id, wpnid = 0)
// ...
stock fm_find_ent_by_owner(id, const classname[], owner, jghgtype = 0)
Take the "stock" tag off, it's unnecessary.
For the most part, these are minor, but this is a small script.
__________________