Weapon Restriction System
Posted: Tue Aug 16, 2016 5:52 pm
I am trying to use the current restriction system included in SP. Was using my old version until I realised there is now a version included, so have opted to use that instead now. However I am getting a few problems when trying to restrict weapons to a player. For some reason it seems to not recognise the team number in the TeamRestrictions dict.
Traceback below:
Traceback below:
Code: Select all
[SP] Caught an Exception:
Traceback (most recent call last):
File '../addons/source-python/packages/source-python/weapons/restrictions.py', line 384, in _on_weapon_bump
make_object(Player, args[0]), edict_from_pointer(args[1]).classname)
File '../addons/source-python/packages/source-python/weapons/restrictions.py', line 67, in on_player_bumping_weapon
value = handler.on_player_bumping_weapon(player, weapon_name)
File '../addons/source-python/packages/source-python/weapons/restrictions.py', line 286, in on_player_bumping_weapon
return not self.is_player_restricted(player, weapon)
File '../addons/source-python/packages/source-python/weapons/restrictions.py', line 312, in is_player_restricted
return self.is_team_restricted(player.team, weapon_name)
File '../addons/source-python/packages/source-python/weapons/restrictions.py', line 322, in is_team_restricted
return weapon_manager[weapon].basename in self.team_restrictions[team]
File '../addons/source-python/packages/source-python/weapons/restrictions.py', line 191, in __getitem__
''{0}' is neither a team number nor an alias.'.format(item))
KeyError: ''3' is neither a team number nor an alias.'