Change the Kill-Weapon-Symbol with take_damage

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
Pudge90
Member
Posts: 33
Joined: Sun Jan 14, 2018 6:18 pm
Location: Germany

Change the Kill-Weapon-Symbol with take_damage

Postby Pudge90 » Fri Feb 02, 2018 10:27 pm

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.
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: Change the Kill-Weapon-Symbol with take_damage

Postby satoon101 » Fri Feb 02, 2018 11:36 pm

https://github.com/Source-Python-Dev-Te ... se.py#L865

You 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,
)
Image
User avatar
Pudge90
Member
Posts: 33
Joined: Sun Jan 14, 2018 6:18 pm
Location: Germany

Re: Change the Kill-Weapon-Symbol with take_damage

Postby Pudge90 » Mon Feb 05, 2018 6:30 pm

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!

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 36 guests