[HL2:DM] Headshot Help

A place for requesting new Source.Python plugins to be made for your server.

Please request only one plugin per thread.
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: [HL2:DM] Headshot Help

Postby L'In20Cible » Wed May 29, 2019 7:09 am

daren adler wrote:

Syntax: Select all

2019-05-29 00:26:48 - sp	-	MESSAGE	[SP] Loading plugin 'country_tag'...
2019-05-29 00:26:48 - sp - MESSAGE [SP] Successfully loaded plugin 'country_tag'.
2019-05-29 00:26:48 - sp - MESSAGE [SP] Loading plugin 'killmessage'...
2019-05-29 00:26:48 - sp - MESSAGE [SP] Successfully loaded plugin 'killmessage'.
2019-05-29 00:26:48 - sp - MESSAGE [SP] Loading plugin 'headshot'...
2019-05-29 00:26:48 - sp - MESSAGE [SP] Successfully loaded plugin 'headshot'.
2019-05-29 00:26:48 - sp - MESSAGE [SP] Unloading plugin 'killmessage'...
2019-05-29 00:26:49 - sp - MESSAGE [SP] Successfully unloaded plugin 'killmessage'.
2019-05-29 00:26:49 - sp - MESSAGE [SP] Unloading plugin 'headshot'...
2019-05-29 00:26:49 - sp - MESSAGE [SP] Successfully unloaded plugin 'headshot'.
2019-05-29 00:26:49 - sp - MESSAGE [SP] Loading plugin 'killmessage'...
2019-05-29 00:26:49 - sp - MESSAGE [SP] Successfully loaded plugin 'killmessage'.
2019-05-29 00:26:49 - sp - MESSAGE [SP] Loading plugin 'headshot'...
2019-05-29 00:26:49 - sp - MESSAGE [SP] Successfully loaded plugin 'headshot'.
2019-05-29 00:26:52 - sp - MESSAGE [SP] Unloading plugin 'killmessage'...
2019-05-29 00:26:52 - sp - MESSAGE [SP] Successfully unloaded plugin 'killmessage'.
2019-05-29 00:26:52 - sp - MESSAGE [SP] Unloading plugin 'headshot'...
2019-05-29 00:26:52 - sp - MESSAGE [SP] Successfully unloaded plugin 'headshot'.
2019-05-29 00:26:53 - sp - MESSAGE [SP] Loading plugin 'killmessage'...
2019-05-29 00:26:53 - sp - MESSAGE [SP] Successfully loaded plugin 'killmessage'.
2019-05-29 00:26:53 - sp - MESSAGE [SP] Loading plugin 'headshot'...
2019-05-29 00:26:53 - sp - MESSAGE [SP] Successfully loaded plugin 'headshot'.
2019-05-29 00:26:57 - sp - MESSAGE [SP] Unloading plugin 'killmessage'...
2019-05-29 00:26:57 - sp - MESSAGE [SP] Successfully unloaded plugin 'killmessage'.
2019-05-29 00:26:57 - sp - MESSAGE [SP] Unloading plugin 'headshot'...
2019-05-29 00:26:57 - sp - MESSAGE [SP] Successfully unloaded plugin 'headshot'.
2019-05-29 00:26:57 - sp - MESSAGE [SP] Loading plugin 'killmessage'...
2019-05-29 00:26:57 - sp - MESSAGE [SP] Successfully loaded plugin 'killmessage'.
2019-05-29 00:26:57 - sp - MESSAGE [SP] Loading plugin 'headshot'...
2019-05-29 00:26:57 - sp - MESSAGE [SP] Successfully loaded plugin 'headshot'.
2019-05-29 00:28:16 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 93, in _pre_take_damage
_damage_weapons[victim.userid] = Player(info.attacker).active_weapon.classname
File "..\addons\source-python\packages\source-python\players\_base.py", line 88, in __init__
super().__init__(index)
File "..\addons\source-python\packages\source-python\entities\_base.py", line 94, in __init__
super().__init__(index)
ValueError: Index '443' is not a valid player.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 96, in _pre_take_damage
raise ValueError(f'Index "{info.attacker}" is not a valid player. Entity classname: {entity.classname}')

ValueError: Index "443" is not a valid player. Entity classname: entityflame


2019-05-29 00:28:16 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 93, in _pre_take_damage
_damage_weapons[victim.userid] = Player(info.attacker).active_weapon.classname
File "..\addons\source-python\packages\source-python\players\_base.py", line 88, in __init__
super().__init__(index)
File "..\addons\source-python\packages\source-python\entities\_base.py", line 94, in __init__
super().__init__(index)
ValueError: Index '443' is not a valid player.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 96, in _pre_take_damage
raise ValueError(f'Index "{info.attacker}" is not a valid player. Entity classname: {entity.classname}')

ValueError: Index "443" is not a valid player. Entity classname: entityflame


2019-05-29 00:28:16 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 93, in _pre_take_damage
_damage_weapons[victim.userid] = Player(info.attacker).active_weapon.classname
File "..\addons\source-python\packages\source-python\players\_base.py", line 88, in __init__
super().__init__(index)
File "..\addons\source-python\packages\source-python\entities\_base.py", line 94, in __init__
super().__init__(index)
ValueError: Index '443' is not a valid player.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 96, in _pre_take_damage
raise ValueError(f'Index "{info.attacker}" is not a valid player. Entity classname: {entity.classname}')

ValueError: Index "443" is not a valid player. Entity classname: entityflame


2019-05-29 00:28:17 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 93, in _pre_take_damage
_damage_weapons[victim.userid] = Player(info.attacker).active_weapon.classname
File "..\addons\source-python\packages\source-python\players\_base.py", line 88, in __init__
super().__init__(index)
File "..\addons\source-python\packages\source-python\entities\_base.py", line 94, in __init__
super().__init__(index)
ValueError: Index '443' is not a valid player.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 96, in _pre_take_damage
raise ValueError(f'Index "{info.attacker}" is not a valid player. Entity classname: {entity.classname}')

ValueError: Index "443" is not a valid player. Entity classname: entityflame


2019-05-29 00:28:17 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 93, in _pre_take_damage
_damage_weapons[victim.userid] = Player(info.attacker).active_weapon.classname
File "..\addons\source-python\packages\source-python\players\_base.py", line 88, in __init__
super().__init__(index)
File "..\addons\source-python\packages\source-python\entities\_base.py", line 94, in __init__
super().__init__(index)
ValueError: Index '443' is not a valid player.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 96, in _pre_take_damage
raise ValueError(f'Index "{info.attacker}" is not a valid player. Entity classname: {entity.classname}')

ValueError: Index "443" is not a valid player. Entity classname: entityflame


2019-05-29 00:28:19 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 93, in _pre_take_damage
_damage_weapons[victim.userid] = Player(info.attacker).active_weapon.classname
File "..\addons\source-python\packages\source-python\players\_base.py", line 88, in __init__
super().__init__(index)
File "..\addons\source-python\packages\source-python\entities\_base.py", line 94, in __init__
super().__init__(index)
ValueError: Index '443' is not a valid player.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 96, in _pre_take_damage
raise ValueError(f'Index "{info.attacker}" is not a valid player. Entity classname: {entity.classname}')

ValueError: Index "443" is not a valid player. Entity classname: entityflame


2019-05-29 00:28:20 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 93, in _pre_take_damage
_damage_weapons[victim.userid] = Player(info.attacker).active_weapon.classname
File "..\addons\source-python\packages\source-python\players\_base.py", line 88, in __init__
super().__init__(index)
File "..\addons\source-python\packages\source-python\entities\_base.py", line 94, in __init__
super().__init__(index)
ValueError: Index '443' is not a valid player.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 96, in _pre_take_damage
raise ValueError(f'Index "{info.attacker}" is not a valid player. Entity classname: {entity.classname}')

ValueError: Index "443" is not a valid player. Entity classname: entityflame


2019-05-29 00:28:20 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 93, in _pre_take_damage
_damage_weapons[victim.userid] = Player(info.attacker).active_weapon.classname
File "..\addons\source-python\packages\source-python\players\_base.py", line 88, in __init__
super().__init__(index)
File "..\addons\source-python\packages\source-python\entities\_base.py", line 94, in __init__
super().__init__(index)
ValueError: Index '443' is not a valid player.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 96, in _pre_take_damage
raise ValueError(f'Index "{info.attacker}" is not a valid player. Entity classname: {entity.classname}')

ValueError: Index "443" is not a valid player. Entity classname: entityflame


2019-05-29 00:28:20 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 93, in _pre_take_damage
_damage_weapons[victim.userid] = Player(info.attacker).active_weapon.classname
File "..\addons\source-python\packages\source-python\players\_base.py", line 88, in __init__
super().__init__(index)
File "..\addons\source-python\packages\source-python\entities\_base.py", line 94, in __init__
super().__init__(index)
ValueError: Index '443' is not a valid player.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 96, in _pre_take_damage
raise ValueError(f'Index "{info.attacker}" is not a valid player. Entity classname: {entity.classname}')

ValueError: Index "443" is not a valid player. Entity classname: entityflame


2019-05-29 00:28:20 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 93, in _pre_take_damage
_damage_weapons[victim.userid] = Player(info.attacker).active_weapon.classname
File "..\addons\source-python\packages\source-python\players\_base.py", line 88, in __init__
super().__init__(index)
File "..\addons\source-python\packages\source-python\entities\_base.py", line 94, in __init__
super().__init__(index)
ValueError: Index '443' is not a valid player.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 96, in _pre_take_damage
raise ValueError(f'Index "{info.attacker}" is not a valid player. Entity classname: {entity.classname}')

ValueError: Index "443" is not a valid player. Entity classname: entityflame


2019-05-29 00:28:30 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 93, in _pre_take_damage
_damage_weapons[victim.userid] = Player(info.attacker).active_weapon.classname
File "..\addons\source-python\packages\source-python\players\_base.py", line 88, in __init__
super().__init__(index)
File "..\addons\source-python\packages\source-python\entities\_base.py", line 94, in __init__
super().__init__(index)
ValueError: Index '446' is not a valid player.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 96, in _pre_take_damage
raise ValueError(f'Index "{info.attacker}" is not a valid player. Entity classname: {entity.classname}')

ValueError: Index "446" is not a valid player. Entity classname: entityflame


2019-05-29 00:28:30 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 93, in _pre_take_damage
_damage_weapons[victim.userid] = Player(info.attacker).active_weapon.classname
File "..\addons\source-python\packages\source-python\players\_base.py", line 88, in __init__
super().__init__(index)
File "..\addons\source-python\packages\source-python\entities\_base.py", line 94, in __init__
super().__init__(index)
ValueError: Index '446' is not a valid player.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 96, in _pre_take_damage
raise ValueError(f'Index "{info.attacker}" is not a valid player. Entity classname: {entity.classname}')

ValueError: Index "446" is not a valid player. Entity classname: entityflame


2019-05-29 00:28:31 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 93, in _pre_take_damage
_damage_weapons[victim.userid] = Player(info.attacker).active_weapon.classname
File "..\addons\source-python\packages\source-python\players\_base.py", line 88, in __init__
super().__init__(index)
File "..\addons\source-python\packages\source-python\entities\_base.py", line 94, in __init__
super().__init__(index)
ValueError: Index '446' is not a valid player.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 96, in _pre_take_damage
raise ValueError(f'Index "{info.attacker}" is not a valid player. Entity classname: {entity.classname}')

ValueError: Index "446" is not a valid player. Entity classname: entityflame


2019-05-29 00:28:31 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 93, in _pre_take_damage
_damage_weapons[victim.userid] = Player(info.attacker).active_weapon.classname
File "..\addons\source-python\packages\source-python\players\_base.py", line 88, in __init__
super().__init__(index)
File "..\addons\source-python\packages\source-python\entities\_base.py", line 94, in __init__
super().__init__(index)
ValueError: Index '446' is not a valid player.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 96, in _pre_take_damage
raise ValueError(f'Index "{info.attacker}" is not a valid player. Entity classname: {entity.classname}')

ValueError: Index "446" is not a valid player. Entity classname: entityflame


2019-05-29 00:28:31 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 93, in _pre_take_damage
_damage_weapons[victim.userid] = Player(info.attacker).active_weapon.classname
File "..\addons\source-python\packages\source-python\players\_base.py", line 88, in __init__
super().__init__(index)
File "..\addons\source-python\packages\source-python\entities\_base.py", line 94, in __init__
super().__init__(index)
ValueError: Index '446' is not a valid player.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 96, in _pre_take_damage
raise ValueError(f'Index "{info.attacker}" is not a valid player. Entity classname: {entity.classname}')

ValueError: Index "446" is not a valid player. Entity classname: entityflame


2019-05-29 00:28:34 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 93, in _pre_take_damage
_damage_weapons[victim.userid] = Player(info.attacker).active_weapon.classname
File "..\addons\source-python\packages\source-python\players\_base.py", line 88, in __init__
super().__init__(index)
File "..\addons\source-python\packages\source-python\entities\_base.py", line 94, in __init__
super().__init__(index)
ValueError: Index '565' is not a valid player.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 96, in _pre_take_damage
raise ValueError(f'Index "{info.attacker}" is not a valid player. Entity classname: {entity.classname}')

ValueError: Index "565" is not a valid player. Entity classname: entityflame


2019-05-29 00:28:34 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 93, in _pre_take_damage
_damage_weapons[victim.userid] = Player(info.attacker).active_weapon.classname
File "..\addons\source-python\packages\source-python\players\_base.py", line 88, in __init__
super().__init__(index)
File "..\addons\source-python\packages\source-python\entities\_base.py", line 94, in __init__
super().__init__(index)
ValueError: Index '565' is not a valid player.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 96, in _pre_take_damage
raise ValueError(f'Index "{info.attacker}" is not a valid player. Entity classname: {entity.classname}')

ValueError: Index "565" is not a valid player. Entity classname: entityflame


2019-05-29 00:28:35 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 93, in _pre_take_damage
_damage_weapons[victim.userid] = Player(info.attacker).active_weapon.classname
File "..\addons\source-python\packages\source-python\players\_base.py", line 88, in __init__
super().__init__(index)
File "..\addons\source-python\packages\source-python\entities\_base.py", line 94, in __init__
super().__init__(index)
ValueError: Index '565' is not a valid player.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 96, in _pre_take_damage
raise ValueError(f'Index "{info.attacker}" is not a valid player. Entity classname: {entity.classname}')

ValueError: Index "565" is not a valid player. Entity classname: entityflame


2019-05-29 00:28:35 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 93, in _pre_take_damage
_damage_weapons[victim.userid] = Player(info.attacker).active_weapon.classname
File "..\addons\source-python\packages\source-python\players\_base.py", line 88, in __init__
super().__init__(index)
File "..\addons\source-python\packages\source-python\entities\_base.py", line 94, in __init__
super().__init__(index)
ValueError: Index '565' is not a valid player.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 96, in _pre_take_damage
raise ValueError(f'Index "{info.attacker}" is not a valid player. Entity classname: {entity.classname}')

ValueError: Index "565" is not a valid player. Entity classname: entityflame


2019-05-29 00:28:35 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 93, in _pre_take_damage
_damage_weapons[victim.userid] = Player(info.attacker).active_weapon.classname
File "..\addons\source-python\packages\source-python\players\_base.py", line 88, in __init__
super().__init__(index)
File "..\addons\source-python\packages\source-python\entities\_base.py", line 94, in __init__
super().__init__(index)
ValueError: Index '565' is not a valid player.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 96, in _pre_take_damage
raise ValueError(f'Index "{info.attacker}" is not a valid player. Entity classname: {entity.classname}')

ValueError: Index "565" is not a valid player. Entity classname: entityflame


2019-05-29 00:28:56 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 93, in _pre_take_damage
_damage_weapons[victim.userid] = Player(info.attacker).active_weapon.classname
File "..\addons\source-python\packages\source-python\players\_base.py", line 88, in __init__
super().__init__(index)
File "..\addons\source-python\packages\source-python\entities\_base.py", line 94, in __init__
super().__init__(index)
ValueError: Index '465' is not a valid player.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 96, in _pre_take_damage
raise ValueError(f'Index "{info.attacker}" is not a valid player. Entity classname: {entity.classname}')

ValueError: Index "465" is not a valid player. Entity classname: entityflame


2019-05-29 00:28:57 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 93, in _pre_take_damage
_damage_weapons[victim.userid] = Player(info.attacker).active_weapon.classname
File "..\addons\source-python\packages\source-python\players\_base.py", line 88, in __init__
super().__init__(index)
File "..\addons\source-python\packages\source-python\entities\_base.py", line 94, in __init__
super().__init__(index)
ValueError: Index '465' is not a valid player.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 96, in _pre_take_damage
raise ValueError(f'Index "{info.attacker}" is not a valid player. Entity classname: {entity.classname}')

ValueError: Index "465" is not a valid player. Entity classname: entityflame


2019-05-29 00:28:57 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 93, in _pre_take_damage
_damage_weapons[victim.userid] = Player(info.attacker).active_weapon.classname
File "..\addons\source-python\packages\source-python\players\_base.py", line 88, in __init__
super().__init__(index)
File "..\addons\source-python\packages\source-python\entities\_base.py", line 94, in __init__
super().__init__(index)
ValueError: Index '465' is not a valid player.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 96, in _pre_take_damage
raise ValueError(f'Index "{info.attacker}" is not a valid player. Entity classname: {entity.classname}')

ValueError: Index "465" is not a valid player. Entity classname: entityflame


2019-05-29 00:28:57 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 93, in _pre_take_damage
_damage_weapons[victim.userid] = Player(info.attacker).active_weapon.classname
File "..\addons\source-python\packages\source-python\players\_base.py", line 88, in __init__
super().__init__(index)
File "..\addons\source-python\packages\source-python\entities\_base.py", line 94, in __init__
super().__init__(index)
ValueError: Index '465' is not a valid player.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 96, in _pre_take_damage
raise ValueError(f'Index "{info.attacker}" is not a valid player. Entity classname: {entity.classname}')

ValueError: Index "465" is not a valid player. Entity classname: entityflame


2019-05-29 00:28:57 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 93, in _pre_take_damage
_damage_weapons[victim.userid] = Player(info.attacker).active_weapon.classname
File "..\addons\source-python\packages\source-python\players\_base.py", line 88, in __init__
super().__init__(index)
File "..\addons\source-python\packages\source-python\entities\_base.py", line 94, in __init__
super().__init__(index)
ValueError: Index '465' is not a valid player.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "..\addons\source-python\plugins\headshot\headshot.py", line 96, in _pre_take_damage
raise ValueError(f'Index "{info.attacker}" is not a valid player. Entity classname: {entity.classname}')

ValueError: Index "465" is not a valid player. Entity classname: entityflame

Yeah, the damage is caused by the entityflame entity. Replace your code with:

Syntax: Select all

from contextlib import suppress

from engines.precache import Model
from engines.sound import Sound
from entities import TakeDamageInfo
from entities.entity import BaseEntity, Entity
from entities.hooks import EntityCondition, EntityPreHook
from events import Event
from listeners.tick import Delay
from memory import make_object
from players.constants import HitGroup
from players.entity import Player
from stringtables.downloads import Downloadables


# =============================================================================
# >> CONFIGURATION
# =============================================================================
REMOVE_OVERLAY_TIME = 1.5

HEADSHOT_OVERLAY_VMT_ATTACKER = "exae/rocksheadshot1.vmt"
HEADSHOT_OVERLAY_VTF_ATTACKER = "exae/rocksheadshot1.vtf"

HEADSHOT_OVERLAY_VMT_VICTIM = "exae/rocksheadshot1.vmt"
HEADSHOT_OVERLAY_VTF_VICTIM = "exae/rocksheadshot1.vtf"

# Headshot but not dead sound + path
HEADSHOT_SOUND = 'exae/quake/human-hit-4.mp3'

# <weapon> : <headshot_sound>
WEAPON_FILES = {
'weapon_crossbow': 'exae/quake/headshot2.mp3',
'weapon_357' : 'exae/quake/headshot-2.mp3',
'weapon_smg1' : 'exae/quake/wife-headshot.mp3',
'weapon_ar2' : 'exae/quake/boomheadshot.mp3',
'weapon_pistol' : 'exae/quake/headshot-1.mp3',
'weapon_shotgun' : 'exae/quake/headshot2.mp3'
}

DEAD_MODEL_PATH = 'models/headless_body/metrocop.mdl'
DEAD_MODEL_DL_FILES = [
"models/headless_body/metrocop.dx80.vtx",
"models/headless_body/metrocop.dx90.vtx",
"models/headless_body/metrocop.mdl",
"models/headless_body/metrocop.phy",
"models/headless_body/metrocop.sw.vtx",
"models/headless_body/metrocop.vvd",
]
# =============================================================================
# >> END OF CONFIGURATION
# =============================================================================


HEADSHOT_SOUND = Sound(HEADSHOT_SOUND, download=True)
WEAPON_FILES = {x: Sound(y, download=True) for x, y in WEAPON_FILES.items()}
downloads = Downloadables()
for item in (HEADSHOT_OVERLAY_VMT_ATTACKER, HEADSHOT_OVERLAY_VTF_ATTACKER,
HEADSHOT_OVERLAY_VMT_VICTIM, HEADSHOT_OVERLAY_VTF_VICTIM):
downloads.add('materials/' + item)

for item in DEAD_MODEL_DL_FILES:
downloads.add(item)

DEAD_MODEL = Model(
path=DEAD_MODEL_PATH,
preload=True,
)

_old_models = {}
_damage_weapons = {}


@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

victim = Player(victim.index)
info = make_object(TakeDamageInfo, stack_data[1])

# World damage?
if info.attacker == 0:
_damage_weapons[victim.userid] = 'worldspawn'

# Was a projectile used?
elif info.attacker != info.inflictor:
_damage_weapons[victim.userid] = Entity(info.inflictor).classname

# Not a projectile
else:
entity = BaseEntity(info.attacker)
if entity.is_player():
_damage_weapons[victim.userid] = Player(entity.index).active_weapon.classname
else:
_damage_weapons[victim.userid] = entity.classname


@Event('player_hurt')
def player_hurt(game_event):
victim = Player.from_userid(game_event['userid'])
attacker_userid = game_event['attacker']

# Suicide?
if attacker_userid in (victim.userid, 0):
return

# Not a headshot?
if victim.hitgroup != HitGroup.HEAD:
return

# Victim still alive?
if game_event['health']:
HEADSHOT_SOUND.index = victim.index
HEADSHOT_SOUND.play(victim.index)
return

weapon_sound = WEAPON_FILES.get(_damage_weapons.get(victim.userid))
if weapon_sound is None:
return

attacker = Player.from_userid(attacker_userid)

# Play weapon specific headshot sound
weapon_sound.play(attacker.index)

# Set the victim's overlay
victim.client_command(
'r_screenoverlay {overlay}'.format(
overlay=HEADSHOT_OVERLAY_VMT_VICTIM
)
)
Delay(REMOVE_OVERLAY_TIME, _remove_overlay, [victim.userid])

# Set the attacker's overlay
attacker.client_command(
'r_screenoverlay {overlay}'.format(
overlay=HEADSHOT_OVERLAY_VMT_ATTACKER
)
)
Delay(REMOVE_OVERLAY_TIME, _remove_overlay, [attacker_userid])

# Set the victim's model
_old_models[victim.userid] = victim.model
victim.model = DEAD_MODEL


@Event('player_spawn')
def _reset_model(game_event):
userid = game_event['userid']
old_model = _old_models.pop(userid, None)
if old_model is not None:
Player.from_userid(userid).model = old_model


def _remove_overlay(userid):
with suppress(Exception):
Player.from_userid(userid).client_command('r_screenoverlay 0')

And it should no longer raise. However, if you want a specific sound when that kind of damage is dealt you will have to add a key to your WEAPON_FILES dictionary. For example:

Syntax: Select all

# <weapon> : <headshot_sound>
WEAPON_FILES = {
'weapon_crossbow': 'exae/quake/headshot2.mp3',
'weapon_357' : 'exae/quake/headshot-2.mp3',
'weapon_smg1' : 'exae/quake/wife-headshot.mp3',
'weapon_ar2' : 'exae/quake/boomheadshot.mp3',
'weapon_pistol' : 'exae/quake/headshot-1.mp3',
'weapon_shotgun' : 'exae/quake/headshot2.mp3', # Note the extra comma here.
'entityflame': 'some_sound.mp3'
}
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

Re: [HL2:DM] Headshot Help

Postby daren adler » Wed May 29, 2019 3:15 pm

OK i will try,,thank you.
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

Re: [HL2:DM] Headshot Help

Postby daren adler » Thu May 30, 2019 9:58 pm

Works great THANK YOU.I was wondering if you guys that made the headshot script can tell me how or (if u will please), to make it so the players/bots headness body skin is the same as the skin they have on,,When you headshot a player/bot the head does come off, but its allways the cop skin,,,say like i shoot alyx headshot and she turns into metrocop, I went on gmod and seen headless bodys for alyx and a few otheres,,i added them with no luck,any help or info would be great ..thank you for your time. :cool:
User avatar
Painkiller
Senior Member
Posts: 725
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

Re: [HL2:DM] Headshot Help

Postby Painkiller » Tue Jun 04, 2019 6:55 am

Hello, now I found this error in the logs.


Code: Select all

2019-06-04 08:42:00 - sp   -   EXCEPTION   
[SP] Caught an Exception:
Traceback (most recent call last):
  File "../addons/source-python/plugins/headshot/headshot.py", line 99, in _pre_take_damage
    _damage_weapons[victim.userid] = Player(info.attacker).active_weapon.weapon_name
  File "../addons/source-python/packages/source-python/players/_base.py", line 88, in __init__
    super().__init__(index)
  File "../addons/source-python/packages/source-python/entities/_base.py", line 94, in __init__
    super().__init__(index)

ValueError: Index '137' is not a valid player.

Return to “Plugin Requests”

Who is online

Users browsing this forum: No registered users and 21 guests