I'm trying to use detonate() on a projectile_hegrenade entity in CS:GO with this code.
Syntax: Select all
@EntityPostHook(EntityCondition.equals_entity_classname("hegrenade_projectile"), 'start_touch')
def Entity_StartTouch(args, ret):
entity = make_object(Entity, args[1])
touching = make_object(Entity, args[0])
if touching.classname == "worldspawn":
if entity.get_key_value_string('targetname') == "cluster":
entity.detonate()
I get the following error:
Code: Select all
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\plugins\es_emulator\eventscripts\wcs\tools\ultimates\default2\default2.py", line 80, in Entity_StartTouch
entity.detonate()
File "..\addons\source-python\packages\source-python\memory\helpers.py", line 331, in __call__
return super().__call__(self._this, *args)
File "<string>", line 1, in <lambda>
RuntimeError: Access violation while writing address '1'.