The first and third errors have nothing to do with this plugin. Make sure when posting tracebacks that you verify the plugin it is coming from.
The first one is coming from
headshot. Notice the first line after
Traceback references the file
../addons/source-python/plugins/headshot/headshot.py:
Syntax: Select all
2017-02-20 19:01:31 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "../addons/source-python/plugins/headshot/headshot.py", line 98, in _pre_take_damage
_damage_weapons[victim.userid] = Player(info.attacker).active_weapon.classname
File "../addons/source-python/packages/source-python/entities/_base.py", line 116, in __getattr__
raise AttributeError('Attribute "{0}" not found'.format(attr))
AttributeError: Attribute "active_weapon" not found
The third one is coming from
savescore. Notice the first line after
Traceback references the file
../addons/source-python/plugins/savescore/savescore.py:
Syntax: Select all
2017-02-20 19:31:45 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "../addons/source-python/plugins/savescore/savescore.py", line 15, in save_player_score
player = Player(index)
File "../addons/source-python/packages/source-python/players/_base.py", line 86, in __init__
super().__init__(index)
File "../addons/source-python/packages/source-python/entities/_base.py", line 94, in __init__
super().__init__(index)
ValueError: Conversion from "Index" (1) to "BaseEntity" failed.
The second one is relevant to this thread, as it references the file
../addons/source-python/plugins/explosive/explosive.py. But, as I stated above, I'm not sure what causes this issue, and we will have to look into it further.
I cannot test locally with multiple players, because my server is being a pain when trying to connect over LAN, so I am unable to verify that slam's work properly. However, I was able to test with frag grenades, smg grenades, and rpg by hurting myself, and all 3 should work fine with the following:
Syntax: Select all
from entities import TakeDamageInfo
from entities.entity import Entity
from entities.hooks import EntityCondition, EntityPreHook
from memory import make_object
from players.entity import Player
from weapons.manager import weapon_manager
DAMAGE_TRIGGERS = [
'weapon_frag',
'weapon_smg1',
'weapon_rpg',
'weapon_slam',
]
@EntityPreHook(EntityCondition.is_player, 'on_take_damage')
def _pre_take_damage(stack_data):
victim = make_object(Entity, stack_data[0])
if not victim.is_player():
return
info = make_object(TakeDamageInfo, stack_data[1])
weapon_index = info.weapon
try:
weapon = weapon_manager[Entity(weapon_index).classname].name
except AttributeError:
return
if weapon in DAMAGE_TRIGGERS:
fragcloud(Player(victim.index))
def fragcloud(victim):
entity = make_object(Entity, victim.give_named_item('env_ar2explosion'))
entity.set_key_value_string('material', 'smoke/smokeball-11-4.vmt')
entity.call_input('Explode')
entity.delay(8, entity.remove)