View Single Post
cssBOT
Senior Member
Join Date: Apr 2009
Old 08-30-2015 , 01:23   Re: Anticamp CS:S - 2.5.2 with CS:GO support
Reply With Quote #111

CS:S Bug:

The cvar sm_anticamp_minhealth states
"Minimum health a camper reserves. Set 0 to slap till dead. If slay set the health from which player will not be killed"

If the cvar is set to 0 for slap till dead they are only slapped down to 1hp and never killed.

The relevant code for this feature:
Code:
    switch(GetConVarInt(g_CvarSlapSlay))
    {
        case 1:
        {
            // slap player
            new SlapDmg = GetConVarInt(g_CvarSlapDmg);

            if(ClientHealth > MinHealth)
            {
                ClientHealth -= SlapDmg;

                if(ClientHealth > MinHealth || MinHealth <= 0)
                    SlapPlayer(client, SlapDmg, true);
                else
                {
                    if(!GetConVarBool(g_CvarPunishAnyway))
                        ResetTimer(client);

                    SetEntityHealth(client, MinHealth);
                    SlapPlayer(client, 0, true);
                }
            }
            else if(GetConVarBool(g_CvarPunishAnyway))
                SlapPlayer(client, 0, true);
        }

The problem is in CS:S you can only slap a player down to 1hp

Fix:
Code:
       if(ClientHealth > MinHealth || MinHealth <= 0)
                {
                    if(ClientHealth <= 0)
                        ForcePlayerSuicide(client);
                    else
                        SlapPlayer(client, SlapDmg, true);
                }
cssBOT is offline