I've recently begun coding for AMXX just to see what things I can do. I'm working right now on a plugin which prevents grenades from being used on maps like fy_iceworld. Here is the code so far (thanks to FrostNades):
Code:
#include <amxmodx>
#include <fakemeta>
#include <engine>
#define PLUGIN "Nade Disabler"
#define VERSION "0.1"
#define AUTHOR "Nomexous"
new nade_pcvar
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
nade_pcvar = register_cvar("amx_disable_grenades", "0")
register_think("grenade", "grenade_think")
}
public grenade_think(ent)
{
if (get_pcvar_num(nade_pcvar)) return PLUGIN_HANDLED
}
This works very well. It's exactly what I want. You can buy grenades and throw them, but they will simply bounce to a halt and not explode.
However, I'm not entirely clear on how this stops the grenades from exploding. And I would like to know a way to make the thrown grenades (now lying forlornly on the ground) to explode on command, taking into account that they can be either flashes, smokes, or HEs.