I have a plugin that should remove all weapons and ammunition from the server.
Except for the 357 and crossbow.
But it just does not work.
Maybe someone can help
Syntax: Select all
from entities.hooks import EntityCondition, EntityPreHook
from entities.helpers import index_from_pointer
from filters.weapons import WeaponClassIter, WeaponIter
from weapons.entity import Weapon
def remove_idle_weapons():
for w in WeaponIter.iterator():
if w.get_property_int('m_hOwnerEntity') in [-1, 0]:
w.call_input('Kill')
@EntityPreHook(EntityCondition.is_human_player, 'bump_weapon')
@EntityPreHook(EntityCondition.is_bot_player, 'bump_weapon')
def pre_pickup(args):
weapon = Weapon(index_from_pointer(args[1]))
if weapon.classname in WeaponClassIter() and not weapon.classname in ['weapon_357', 'weapon_crossbow']:
remove_idle_weapons()
return False
Greeting Painkiller