Here.
I added a time delay for touch so they don't pick up the grenade back up again when they drop it. I used pdata native instead of dod_set_user_ammo.
Also added a fix for g_cvarSmoke = get_cvar_pointer(... If the Zor plugin wasn't loaded you would get an runtime error since get_cvar_pointer will return invalid pointer.
I also found out that dod_get/set_user_ammo for DODW_HANDGRENADE and DODW_STICKGRENADE were using offsets that don't really deal with ammo amount. When setting those other offset did nothing to change the grenades that was in dod_get/set_user_ammo for the hand grenade and stick grenade had no affect on adding more or taking away from their grenade ammo.
DODW_HANDGRENADE: 289
DODW_STICKGRENADE: 291
+5 for linux
Only the two values above did something
Also you can instead of hooking think. You can let the engine remove it for you ( I think this should work since the next think of the entity is get_gametime() + x seconds.
Code:
//under
set_pev( ent, pev_nextthink, get_stay_time() );
//add
set_pev(ent, pev_flags, pev(ent, pev_flags) |= FL_KILLME);
Then the engine will remove it when it time. and remove the Think forward
edit:
One more change... You need to move get_cvar_pointer to plugin_cfg .. You have to do that in there if it a register cvar from another plugin.
Or you will have to set this plugin under the other plugin with that cvar.
LINUX VERSION TESTED ONLY.