/* Plugin generated by AMXX-Studio */ #include #include #include #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "author" #define DROPED 1 #define ITAG "INFO" new info[8] public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) ent_garbage_collector() } stock ent_kill(id) { entity_set_int(id, EV_INT_flags, (entity_get_int(id, EV_INT_flags) | FL_KILLME)) } public ent_garbage_collector() { new wprefix[] = "weapon_", class[32] new wbox, wbox_class[] = "weaponbox" new startent = get_maxplayers() + 1 new endent = get_global_int(GL_maxEntities) new j = 0 for (new i = startent; i <= endent; i++) { if (!is_valid_ent(i)) continue entity_get_string(i, EV_SZ_classname, class, 31) if (equal(class, "weapon_shield") || equal(class, "item_thighpack") || equal(class, "item_assaultsuit")) { ent_kill(i) j++ continue } if (contain(class, wprefix) != -1) { wbox = entity_get_edict(i, EV_ENT_owner) if (wbox < startent || !is_valid_ent(wbox)) continue entity_get_string(wbox, EV_SZ_classname, class, 31) if (contain(class, wbox_class) != -1) { ent_kill(wbox) ent_kill(i) j += 2 } } } info[DROPED] += j if (j) client_print(0, print_chat, "[%s] %d entities removed (total %d)", ITAG, j, info[DROPED]) }