I was searching for codes those can remove c4 bomb from server and when i found one i get many problems so i got this code from zombie plague mod but it's not working with me and What dose those codes do.
zombieplague.ini file
Quote:
[Objective Entities] (and anything that would affect gameplay that needs to be removed)
CLASSNAMES = func_bomb_target , info_bomb_target , info_vip_start , func_vip_safetyzone , func_escapezone , hostage_entity , monster_scientist , func_hostage_rescue , info_hostage_rescue , env_fog , env_rain , env_snow , item_longjump , func_vehicle
|
PHP Code:
case SECTION_OBJECTIVE_ENTS:
{
if (equal(key, "CLASSNAMES"))
{
// Parse classnames
while (value[0] != 0 && strtok(value, key, charsmax(key), value, charsmax(value), ','))
{
// Trim spaces
trim(key)
trim(value)
// Add to objective ents array
ArrayPushString(g_objective_ents, key)
}
}
}
PHP Code:
new Array:g_objective_ents
g_objective_ents = ArrayCreate(32, 1)
// Prevent some entities from spawning
g_fwSpawn = register_forward(FM_Spawn, "fw_Spawn")
unregister_forward(FM_Spawn, g_fwSpawn)
// Entity Spawn Forward
public fw_Spawn(entity)
{
// Invalid entity
if (!pev_valid(entity)) return FMRES_IGNORED;
// Get classname
new classname[32], objective[32], size = ArraySize(g_objective_ents)
pev(entity, pev_classname, classname, charsmax(classname))
// Check whether it needs to be removed
for (new i = 0; i < size; i++)
{
ArrayGetString(g_objective_ents, i, objective, charsmax(objective))
if (equal(classname, objective))
{
engfunc(EngFunc_RemoveEntity, entity)
return FMRES_SUPERCEDE;
}
}
return FMRES_IGNORED;
}