Raised This Month: $32 Target: $400
 8% 

[L4D2] Digestion (1.2)


Post New Thread Reply   
 
Thread Tools Display Modes
Crazygamer34894
Senior Member
Join Date: Feb 2013
Location: Cape Town Western Cape
Old 11-05-2014 , 08:16   Re: [L4D2] Digestion (1.2)
Reply With Quote #21

Quote:
Originally Posted by paul92 View Post
Reporting some error that spams my logs... Any idea on how to fix it?
Code:
L 04/19/2014 - 01:46:03: [SM] Native "GetClientTeam" reported: Client 6 is not in game
L 04/19/2014 - 01:46:03: [SM] Displaying call stack trace for plugin "l4d2_digestion.smx":
L 04/19/2014 - 01:46:03: [SM]   [0]  Line 189, C:\Program Files (x86)\Steam\steamapps\common\left 4 dead 2\left4dead2\addons\sourcemod\scripting\l4d2_digestion.sp::Event_PlayerDeath()
Code:
public Action:Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast) {
    new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
    new target = GetClientOfUserId(GetEventInt(event, "userid"));
    new bonus;
    new maxHP;
    new enable;
    new oldHealth;
    new newHealth;
    if(attacker <= 0 || target <= 0) {
        return Plugin_Continue;
    }
    if(!IsClientInGame(attacker) || !IsPlayerAlive(attacker)) {
        return Plugin_Continue;
    }
    
    if((GetClientTeam(target) == 2) && (GetClientTeam(attacker) == 3)) {
        new class = GetEntProp(attacker, Prop_Send, "m_zombieClass");
        
        switch (class)  
        {    
            case ZOMBIECLASS_BOOMER:
            {
                bonus = GetConVarInt(FindConVar("sm_digestion_boomer_kill"));
                maxHP = GetConVarInt(FindConVar("sm_digestion_boomer_healmaxhp"));
                enable = GetConVarBool(FindConVar("sm_digestion_boomer_enable"));
            }
            
            case ZOMBIECLASS_CHARGER:
            {
                bonus = GetConVarInt(FindConVar("sm_digestion_charger_kill"));
                maxHP = GetConVarInt(FindConVar("sm_digestion_charger_healmaxhp"));
                enable = GetConVarBool(FindConVar("sm_digestion_charger_enable"));
            }
            
            case ZOMBIECLASS_JOCKEY:
            {
                bonus = GetConVarInt(FindConVar("sm_digestion_jockey_kill"));
                maxHP = GetConVarInt(FindConVar("sm_digestion_jockey_healmaxhp"));
                enable = GetConVarBool(FindConVar("sm_digestion_jockey_enable"));
            }
            case ZOMBIECLASS_HUNTER:
            {
                bonus = GetConVarInt(FindConVar("sm_digestion_hunter_kill"));
                maxHP = GetConVarInt(FindConVar("sm_digestion_hunter_healmaxhp"));
                enable = GetConVarBool(FindConVar("sm_digestion_hunter_enable"));
            }
            
            case ZOMBIECLASS_SMOKER:
            {
                bonus = GetConVarInt(FindConVar("sm_digestion_smoker_kill"));
                maxHP = GetConVarInt(FindConVar("sm_digestion_smoker_healmaxhp"));
                enable = GetConVarBool(FindConVar("sm_digestion_smoker_enable"));
            }
            
            case ZOMBIECLASS_SPITTER:
            {
                bonus = GetConVarInt(FindConVar("sm_digestion_spitter_kill"));
                maxHP = GetConVarInt(FindConVar("sm_digestion_spitter_healmaxhp"));
                enable = GetConVarBool(FindConVar("sm_digestion_spitter_enable"));
            }
            
            case ZOMBIECLASS_TANK:
            {
                bonus = GetConVarInt(FindConVar("sm_digestion_tank_kill"));
                maxHP = GetConVarInt(FindConVar("sm_digestion_tank_healmaxhp"));
                enable = GetConVarBool(FindConVar("sm_digestion_tank_enable"));
            }
        }
        if(!enable || bonus <= 0) {
            return Plugin_Continue;
        }
        oldHealth = GetClientHealth(attacker);
        newHealth = bonus + oldHealth;
        //PrintHintTextToAll("%N got %d health for killing %N.", attacker, bonus, target);
        if(newHealth > maxHP) {
            newHealth = maxHP;
        }
        if(newHealth > 65355) {
            newHealth = 65355;
        }
        SetEntityHealth(attacker, newHealth);
    }
    return Plugin_Continue;
}
After some time that this errors get added on my log, the game crashes.

Can someone quickfix it?
this plugin is A FANTASTIC Idea. Bonus healing for the infected. and the servers that use Bonus healing for survivors as well .. this make a Competitive left 4 Dead 2 Versus
__________________
Crazygamer34894 is offline
Send a message via Yahoo to Crazygamer34894 Send a message via Skype™ to Crazygamer34894
BloodyBlade
Senior Member
Join Date: Feb 2018
Old 08-11-2019 , 15:28   Re: [L4D2] Digestion (1.2)
Reply With Quote #22

* Converted plugin source to the latest syntax. Requires SourceMod 1.8 or newer.
* Fixed: "Native "GetClientTeam" reported: Client 6 is not in game"
Attached Files
File Type: sp Get Plugin or Get Source (l4d2_digestion.sp - 369 views - 13.8 KB)

Last edited by BloodyBlade; 09-03-2019 at 12:22.
BloodyBlade is offline
paul92
Senior Member
Join Date: Sep 2010
Old 09-28-2019 , 09:00   Re: [L4D2] Digestion (1.2)
Reply With Quote #23

Quote:
Originally Posted by BloodyBlade View Post
* Converted plugin source to the latest syntax. Requires SourceMod 1.8 or newer.
* Fixed: "Native "GetClientTeam" reported: Client 6 is not in game"
Thank you!

Ehi, are you by any chance able to add assist damage to the healing system?
As of now only direct damage count. Boomers assist damage (which is the main way he does damage) doesn't count.

Do you think you could maybe add it? As of now this is useless for the boomer.
It would be cool to have a cvar where you can set the percentage of healing gained from assisted damage too.

Last edited by paul92; 09-28-2019 at 09:01.
paul92 is offline
Reply


Thread Tools
Display Modes

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 18:35.


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