Trigger Ham_Killed from Ham_TakeDamage
Hey guys! I got a code for a grenade launcher and it uses ExecuteHamB with Ham_TakeDamage to dish out the damage to be dealt. The death message reads that the player got killed by a "worldspawn " and I was hoping of making a custom DeathMsg for it.
I've researched around and think Ham_Killed is the best way to do it. But I can't find any example code and am very new to HamSandwich. I need the Ham_Killed to detect if the player in Ham_TakeDamage gets killed and then execute some code. Can you guys help me?... |
Re: [HELP] Trigger Ham_Killed from Ham_TakeDamage
One way of doing this would be by using make_deathmsg
|
Re: [HELP] Trigger Ham_Killed from Ham_TakeDamage
Quote:
|
Re: [HELP] Trigger Ham_Killed from Ham_TakeDamage
1 Attachment(s)
sorry about that, I forgot to include the plugin
PHP Code:
|
Re: [HELP] Trigger Ham_Killed from Ham_TakeDamage
Quote:
the other thing about this is, the weapon is an OTs-14 Groza with a GP-30 Grenade Launcher attached. so there's actually 2 ways to kill a player with this single weapon. the Groza's deathmsg works fine. it's the GP-30 that's giving the "worldspawn" deathmsg and i'm hoping to fix that... |
Re: [HELP] Trigger Ham_Killed from Ham_TakeDamage
PHP Code:
What you could do is create an entity with your desired classname before you execute TakeDamage, and input its index in that 3rd param, and then remove that entity afterwards. |
Re: [HELP] Trigger Ham_Killed from Ham_TakeDamage
Quote:
By the way, please don't laugh at my plugin. That came from Dias' OICW plugin but i've added a substantial amount of code there that you guys might find perplexing or even laughable... |
Re: [HELP] Trigger Ham_Killed from Ham_TakeDamage
PHP Code:
|
Re: [HELP] Trigger Ham_Killed from Ham_TakeDamage
Quote:
What you did there is put 4 (CSW_HEGRENADE is equal to 4) as inflictor in there, which is a "player" entity as they are in entity slots 1 through 32. Quote:
|
Re: [HELP] Trigger Ham_Killed from Ham_TakeDamage
sorry i took so long to reply. it actually worked but i wanted to test it thoroughly so i know what to say when i get back here. ok so now i'm going to try and elaborate in case others are researching this as well. the code now looks like this:
PHP Code:
PHP Code:
for the icon i needed to edit my sprites\hud.txt file, add a "gp30" entry there. that also meant editing an actual sprite file so i can add the icon there. i did some tests to see if it would conflict with the real he grenade. so far no conflicts what-so-ever. everything is working the way they should. Thanks for all the help guys! Here's some bacon, it's all I can give for now... :bacon!: |
| All times are GMT -4. The time now is 18:37. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.