PHP Code:
for(new id=0; id<maxplayers; id++) {
to
PHP Code:
for(new id=1; id<=maxplayers; id++) {
After that, add the check to see if its alive.
PHP Code:
public pluginrequired() {
new bombsiteid
bombsiteid = fm_find_ent_by_class(maxplayers, "func_bomb_target")
if (pev_valid(bombsiteid)) return true
bombsiteid = fm_find_ent_by_class(maxplayers, "info_bomb_target")
if (pev_valid(bombsiteid)) return true
return false
}
PHP Code:
public pluginrequired() {
new bombsiteid = fm_find_ent_by_class(maxplayers, "func_bomb_target")
if (pev_valid(bombsiteid)) return true
bombsiteid = fm_find_ent_by_class(maxplayers, "info_bomb_target")
return (pev_valid(bombsiteid))
}
PHP Code:
public plugin_init() {
register_plugin(PLUG_NAME, PLUG_VERS, PLUG_AUTH)
gmsgBombDrop = get_user_msgid("BombDrop")
maxplayers = get_maxplayers()
set_task(REFRESH_TIME, "radar_event", TASKID_REFRESHRADAR, _, _, "b")
if (!pluginrequired()) pause("ad")
return PLUGIN_CONTINUE
}
Why pause?
PHP Code:
public plugin_init() {
register_plugin(PLUG_NAME, PLUG_VERS, PLUG_AUTH)
if(pluginrequired())
{
gmsgBombDrop = get_user_msgid("BombDrop")
maxplayers = get_maxplayers()
set_task(REFRESH_TIME, "radar_event", TASKID_REFRESHRADAR, _, _, "b")
}
}
Other things to change:
Replace the task with a thinking entity.
Use Ham_Item_Drop to detect the C4 drop (anyone correct me if i'm wrong)
After droping make the entity think.
On round end and/or when someone collects it make it stop thinking.
__________________