I edited the code a bit so when a weapon is dropped it will get deleted from the map. You can get it to work as you want it to with some extra variables and if statements.
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <cstrike>
// plugin's main information
#define PLUGIN_NAME "No Weapon Drop [edited]"
#define PLUGIN_VERSION "0.1"
#define PLUGIN_AUTHOR "VEN [edited by bugsy]"
new const g_wbox_class[] = "weaponbox"
new const g_wbox_model[] = "models/w_weaponbox.mdl"
new const g_model_prefix[] = "models/w_"
#define CLIENT_START_INDEX 1
new g_max_clients
new g_max_entities
public plugin_init() {
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_forward(FM_SetModel, "forward_set_model")
g_max_clients = global_get(glb_maxClients)
g_max_entities = global_get(glb_maxEntities)
}
public forward_set_model(ent, const model[])
{
if (!pev_valid(ent) || !equali(model, g_model_prefix, sizeof g_model_prefix - 1) || equali(model, g_wbox_model))
return FMRES_IGNORED
new id = pev(ent, pev_owner)
if (!(CLIENT_START_INDEX <= id <= g_max_clients))
return FMRES_IGNORED
static class[32]
pev(ent, pev_classname, class, sizeof class - 1)
if (!equal(class, g_wbox_class))
return FMRES_IGNORED
for (new i = g_max_clients + 1; i < g_max_entities; ++i) {
if (!pev_valid(i) || ent != pev(i, pev_owner))
continue
dllfunc(DLLFunc_Think, ent)
return FMRES_IGNORED
}
return FMRES_IGNORED
}
__________________