There must be a way to optimize this, I just can't think of it. :S
Code:
static arg[2], nade, class[21];
read_argv(1, arg, 1);
switch(arg[0])
{
case 'f':
{
if(!get_pcvar_num(g_pFlash))
{
return PLUGIN_HANDLED;
}
nade = CSW_FLASHBANG;
copy(class, 20, "weapon_flashbang");
}
case 'h':
{
if(!get_pcvar_num(g_pHE))
{
return PLUGIN_HANDLED;
}
nade = CSW_HEGRENADE;
copy(class, 20, "weapon_hegrenade");
}
case 's':
{
if(!get_pcvar_num(g_pSmoke))
{
return PLUGIN_HANDLED;
}
nade = CSW_SMOKEGRENADE;
copy(class, 20, "weapon_smokegrenade");
}
}
Thanks in advance.
__________________