View Single Post
Naydef
Senior Member
Join Date: Dec 2015
Location: Doom Town, Nevada
Old 11-10-2018 , 11:47   Re: [TF2] Medigun healing enemy players help
Reply With Quote #6

Quote:
Originally Posted by PC Gamer View Post
Naydef... Thanks for sharing your code!

Question: Code above works to heal enemy players. However, it didn't allow me to heal buildings when running on a Windows dedicated server. Can you add the code that allows for healing buildings?
You can make something like this:
PHP Code:
public MRESReturn Detour_AllowedToHealTargetPost(int pThisHandle hReturnHandle hParams)
{
    if(
pThis==-|| DHookIsNullParam(hParams1))
    {
        return 
MRES_Ignored;
    }
    
int targettoheal=DHookGetParam(hParams1);
    if(
IsValidEntity(targettoheal) && targettoheal>MaxClients)
    {
        if(
HasEntProp(targettohealProp_Send"m_iHealth"))
        {
            
int health=GetEntProp(targettohealProp_Send"m_iHealth");
            
SetEntProp(targettohealProp_Send"m_iHealth"health+5);
        }
    }
    
DHookSetReturn(hReturntrue); // Just try the medigun in the game :)
    
return MRES_ChangedOverride;

Edit: Many things forgot to make...
__________________
My plugins:
*None for now*


Steam:
naydef

Last edited by Naydef; 11-10-2018 at 13:00. Reason: Many things forgot to make...
Naydef is offline