View Single Post
xZk
Senior Member
Join Date: Nov 2017
Location: cl
Old 04-08-2020 , 12:39   Re: [L4D/L4D2] Heal Refuse
Reply With Quote #5

Nice idea!, regarding canceling healing, perhaps this can be helpful in not removing the player's kit
PHP Code:
public Action OnTimerCheckIfInterrupted(Handle timerany healerID) {
    
int healer GetClientOfUserId(healerID);
    if (
healer && healingTarget[healer] != 0) {
        if (
isPlayerAliveSurvivor(healer)) {
            
int item GetPlayerWeaponSlot(healer3);
            
int activeWeapon GetEntPropEnt(healerProp_Send"m_hActiveWeapon");
            if (
item != -&& item == activeWeapon) {
                
char classname[32];
                
GetEntityClassname(itemclassnamesizeof classname);
                if (
StrEqual(classname"weapon_first_aid_kit")) {
                    
//RemovePlayerItem(healer, item);
                    //AcceptEntityInput(item, "Kill");
                    //giveItem(healer, "first_aid_kit");
                    
int target GetEntPropEnt(healerProp_Send"m_useActionTarget");
                    if(
isPlayerAliveSurvivor(target)){
                        
SetEntPropEnt(targetProp_Send"m_useActionOwner"0);
                        
SetEntPropEnt(targetProp_Send"m_useActionTarget"0);
                        
SetEntProp(targetProp_Send"m_iCurrentUseAction"0);
                    }
                    
SetEntPropEnt(healer,  Prop_Send"m_useActionTarget"0);
                    
SetEntPropEnt(healerProp_Send"m_useActionOwner"0);
                    
SetEntProp(healerProp_Send"m_iCurrentUseAction"0);
                    
                }
            }
        }
    }

xZk is offline