hi! how to use fun's
give_item() properly? I'm trying to give grenades to player when he throwing 'em but it gives me only flashbangs. Can someone help me and tell where are errors here?
Code:
#include <amxmodx>
#include <fun>
#include <csx>
new pCvar
public plugin_init() {
register_plugin("infinite_grenades", "latest", "kww")
pCvar = register_cvar("sv_testcvar", "1", FCVAR_SERVER)
}
public grenade_throw(id, gid, wid) {
if(!get_pcvar_num(pCvar))
return PLUGIN_HANDLED
switch(wid) {
case CSW_HEGRENADE: give_item(id, "weapon_hegrenade")
case CSW_FLASHBANG: give_item(id, "weapon_flashbang")
case CSW_SMOKEGRENADE: give_item(id, "weapon_smokegrenade")
}
return PLUGIN_CONTINUE
}