Change suicide to regular kill
Hello,
I tried to search, but i didn't found any specific way how to change suicide to regular kill. I mean lets say i have a plugin that poison enemy when he gets shot. And then it takes him 3 HP/s. And when it reaches zero he just die. In death messages it shows up like suicide etc. But i want it to show like kill (show name who killed him and give him frag). Thanks for help! |
Re: Change suicide to regular kill
The plugin must store the killer and then parse it into the deathmsg or to the function that deals the damage.
Show your code if you want real help. |
Re: Change suicide to regular kill
I think I would execute ham_takedamage when damage is given to the victim with the killer's id as attacker (and probably inflictor). That way, the killer get's teh kill.
|
Re: Change suicide to regular kill
Hunter-Digital: Sorry but i don't have any code yet. Thats what i am asking for ;-)
fysiks: Thanks So it should look like this? Code:
g_player_killed_by[MAXPLAYERS+1] = 0; |
Re: Change suicide to regular kill
If you're making it, you don't need to store the attacker then if you'll use ExecuteHam().
Input for ExecuteHam() is like the callback's inputs: Quote:
Code:
ExecuteHam(Ham_TakeDamage, victim, inflictor, attacker, 3.0, DMG_POISON)Also your "doPoison" is not called by anything... and registering Ham_TakeDamage doesn't really do anything there, unless that's the way you're triggering poison, but I can't see it be called. |
Re: Change suicide to regular kill
Oh i see. Thank you very much for your help ;-)
PS: doPoison is not called because it was there just for demonstration. It will be part of greater plugin ;-) And about Ham_TakeDamage - i thought that it's triggered when i use set_user_health, but it really doesn't make sense (i am setting user's health, not dealing damage to him, so really no reason to trigger ham_takedamage) :-D Thank you very much ;-) |
Re: Change suicide to regular kill
Last question: What should inflictor be? :-)
|
Re: Change suicide to regular kill
Inflictor is the entity that caused the damage. Like a weapon or another entity (Damage block in bm for example)
|
Re: Change suicide to regular kill
Quote:
|
Re: Change suicide to regular kill
So what should it be if i want to show skull image in deathmsg? I knew that all you wrote, but i don't know what should it be now.. Because he wasn't killed by any weapon.. Or by any other entity.. He just died because of "poison"..
|
| All times are GMT -4. The time now is 03:20. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.