Change the Kill-Weapon-Symbol with take_damage
Posted: Fri Feb 02, 2018 10:27 pm
by Pudge90
Is it possible to change the Kill_Weapon-Symbol with 'take_damage'? I'd like to deal damage to a player through
Syntax: Select all
player.take_damage(100, player.index)
But I dont want the generic skull-symbol but a grenade.
Re: Change the Kill-Weapon-Symbol with take_damage
Posted: Fri Feb 02, 2018 11:36 pm
by satoon101
https://github.com/Source-Python-Dev-Te ... se.py#L865You seem to be passing the player's index as the damage_type. If you pass the player's index as the attacker_index and do not pass a weapon_index, it will use the player's active weapon. If you pass a weapon_index and not the attacker_index, it will retrieve the attacker as the owner of the weapon. You can even pass both and use a weapon that the attacker doesn't even own (or one of the weapons the attacker does own, your choice).
*Edit: ie
Syntax: Select all
player.take_damage(
damage=100,
attacker_index=player.index,
weapon_index=Entity.find_or_create('weapon_hegrenade').index,
)
Re: Change the Kill-Weapon-Symbol with take_damage
Posted: Mon Feb 05, 2018 6:30 pm
by Pudge90
For some reason that does not work the way I intended it to do. It still gives me the skull-icon at the top right of the screen and not the grenade-icon.
*Edit
It does work, I just tried to use myself as attacker and victim at the same time, which I guess caused CSGO to automatically set the skull since I technically killed myself. Sorry.
Thank you for helping me satoon101!