Instead of doing this a bunch of times:
Code:
register_clcmd("say /needshotgun", "fnSayNeedShotGun")
->
Code:
register_clcmd("say /need", "fnHookSayNeed");
// ...
public fnHookSayNeed(id)
{
// bla bla read_arg here or w/e
if (equal(arg, "shotgun"))
GiveWeapon(WEAPON_SHOTGUN);
}
Of course you would create a GiveWeapon() function (hopefully with weapon enumerations). But it would also be better to store all the weapon names or w/e in a cache, loop through them witch matches up with the weapon enumerations, and pass the iterator (I hope I used that correctly).
__________________