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

Clarify executehamb


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kowalsky
Senior Member
Join Date: Mar 2015
Location: Poland
Old 10-13-2017 , 12:33   Clarify executehamb
Reply With Quote #1

Hey.

I would like to know a little bit better how ExecuteHam, particularly Ham_Killed native works. If I run the following code :

Code:
ExecuteHamB(Ham_Killed, victim, killer, shouldgib);

Will the deathmessage (deathmsg) be shown with victim {skull} attacker? Do I need to manually set victim's deaths and attacker's frags? Or the hamsandwich module does it?

Additionally I have the same questions about executeham ham_takedamage.
__________________
I ONLY LOVE STEAM, NON-STEAM IS VERY BAD FOR YOUR HEALTH!
Kowalsky is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 10-13-2017 , 12:58   Re: Clarify executehamb
Reply With Quote #2

Hamsandwich does nothing, it just calls the provided virtual function for the provided entity. All functionality of functions that ExecuteHam[B] calls is within the game itself and is mod-dependent.

If you are talking about Counter-Strike you may take a look in ReGameDLL_CS, specifically the dlls/player.cpp file, and find CBasePlayer::Killed and CBasePlayer::TakeDamage functions.

Last edited by klippy; 10-13-2017 at 12:59.
klippy is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 10-13-2017 , 14:40   Re: Clarify executehamb
Reply With Quote #3

By default you should use ExecuteHamB and only in special cases ExecuteHam.
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-13-2017 , 16:33   Re: Clarify executehamb
Reply With Quote #4

https://github.com/s1lentq/ReGameDLL...ayer.cpp#L2023

By calling Ham_Killed you call CBasePlayer::Killed from gamedll, which will trigger the same code as if a player was killed as per usual. Hamsandwich module is just hooking/calling virtual functions from game, it does not do anything else(it will trigger the code that from the above link in this case).
__________________

Last edited by HamletEagle; 10-13-2017 at 16:34.
HamletEagle is offline
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 16:19.


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