Raised This Month: $51 Target: $400
 12% 

ham takedamage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Neon123
Senior Member
Join Date: Jan 2016
Old 01-08-2022 , 16:10   ham takedamage
Reply With Quote #1

im using

ExecuteHamB(Ham_TakeDamage, Victim , "Arrow", Attacker, fDamage, DMG_BULLET)

but in game i getting player killed player with breakable

i cant understand why
Neon123 is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 01-08-2022 , 16:28   Re: ham takedamage
Reply With Quote #2

The second parameter of Ham_TakeDamage is the index of the entity that is doing the damage, usually, it is the attacker index.

Code:
ExecuteHamB(Ham_TakeDamage, Victim, Attacker, Attacker, fDamage, DMG_BULLET)
__________________








CrazY. is offline
Neon123
Senior Member
Join Date: Jan 2016
Old 01-08-2022 , 17:12   Re: ham takedamage
Reply With Quote #3

thanks now im understand, so i cant change the weapon name with ham_takedamage ? like fake_damage
Neon123 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-08-2022 , 17:44   Re: ham takedamage
Reply With Quote #4

Ham_TakeDamage doesn't deal with any weapon names at all. It deals with entities. If you're curious of what values to you, you should write a test plugin that hooks TakeDamage and see what kind of values occur when the type of damage occurs that you're looking to replicate.
__________________
fysiks is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 01-08-2022 , 17:55   Re: ham takedamage
Reply With Quote #5

If what you're trying to do is change the message you get in the console when a player kills someone, hook DeathMsg and alter the value of the fourth parameter or if your "Arrow" is an entity, pass its index in the second parameter of Ham_TakeDamage instead of the attacker index.


https://wiki.alliedmods.net/Half-lif...vents#DeathMsg

Quote:
<attacker name> killed <victim name> with knife
__________________









Last edited by CrazY.; 01-08-2022 at 17:58.
CrazY. is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 01-08-2022 , 18:09   Re: ham takedamage
Reply With Quote #6

PHP Code:
                const PLAYER_GIBS 2;
                static 
iMSG_DEATHMSG 0iOldValue;
                if(!
iMSG_DEATHMSGiMSG_DEATHMSG get_user_msgid("DeathMsg");
                
                
iOldValue get_msg_block(iMSG_DEATHMSG);
                
set_msg_block(iMSG_DEATHMSGBLOCK_SET);
                
ExecuteHamB(Ham_KilledtoucherkillerPLAYER_GIBS);
                
set_msg_block(iMSG_DEATHMSGiOldValue);

                
emessage_begin(MSG_ALLiMSG_DEATHMSG, {0,0,0}, 0);
                
ewrite_byte(killer);
                
ewrite_byte(toucher);
                
ewrite_byte(false);
                
ewrite_string("Arrow");
                
emessage_end(); 
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 01-08-2022 at 18:10.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:46.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode