here is the code crashes:
Syntax: Select all
from players.entity import Player
from events.hooks import PreEvent
@PreEvent('player_hurt')
def player_hurt(args):
if args.get_int('attacker') > 1:
hurter = Player.from_userid(args['attacker'])
victim = Player.from_userid(args['userid'])
if hurter.is_bot():
victim.client_command('kill', True)
Here is the sp info
Code: Select all
[2021-08-29 00:26:37]: --------------------------------------------------------
[2021-08-29 00:26:37]: Checksum : 59e4e4e4182f6803350b42eac3be0519
[2021-08-29 00:26:37]: Date : 2021-08-28 21:26:37.302930
[2021-08-29 00:26:37]: OS : Linux-4.15.0-129-generic-x86_64-with-debian-10.10
[2021-08-29 00:26:37]: Game : css[2021-08-29 00:26:37]: SP version : 705
[2021-08-29 00:26:37]: Github commit : 38e4fe48579f9445b878624a9439ce10e28aa7e6
[2021-08-29 00:26:37]: Server plugins:
[2021-08-29 00:26:37]: 00: Metamod:Source 1.11.0-dev+1144
[2021-08-29 00:26:37]: 01: Source.Python, (C) 2012-2020, Source.Python Team.
[2021-08-29 00:26:37]: SP plugins:
[2021-08-29 00:26:37]: 00: rpg
[2021-08-29 00:26:37]: 01: items
[2021-08-29 00:26:37]: 02: chat
[2021-08-29 00:26:37]: 03: rpgmarket, 1.0.0, https://cssbestrpg.online
[2021-08-29 00:26:37]: 04: zr, 1.6.0, https://forums.sourcepython.com/viewtopic.php?f=7&t=2506
[2021-08-29 00:26:37]: --------------------------------------------------------