To not create a new thread, I've changed the title and the first post.
So, how can I block any entity from picking up except C4?
It just can't catch 'models/w_c4.mdl' while catches any other model perfectly.
Code:
#include <fakemeta>
public plugin_init()
register_forward(FM_Touch, "fwTouch");
public fwTouch(iEnt, iCl)
{
if (!pev_valid(iEnt) || !is_user_alive(iCl))
return FMRES_IGNORED;
static szClass[32], szMdl[32];
pev(iEnt, pev_classname, szClass, sizeof(szMdl) - 1);
pev(iEnt, pev_model, szMdl, sizeof(szMdl) - 1);
if (equali(szClass, "weaponbox") || equali(szClass, "armoury_entity")
|| equali(szClass, "weapon_shield") || equali(szClass, "grenade")))
if (!equali(szMdl, "models/w_c4.mdl"))
return FMRES_SUPERCEDE;
return FMRES_IGNORED;
}
__________________