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

remove knife and teaser damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
thekings4fun
Member
Join Date: Apr 2020
Old 04-15-2020 , 09:36   remove knife and teaser damage
Reply With Quote #1

I'm new here on the forum, we have a 4fun server, and we don't have tk, but we left the tk for molotov and grenades, I would like to know how we removed the tk from the knife and teaser, because we use the following config. we need to prevent members of the same team from stabbing their teammates.

mp_friendlyfire 1
ff_damage_reduction_bullets 0.0
ff_damage_reduction_grenade 0.3
ff_damage_reduction_grenade_self 1
ff_damage_reduction_other 0.45
thekings4fun is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-15-2020 , 13:16   Re: remove knife and teaser damage
Reply With Quote #2

Try this code

csgo
PHP Code:
#include <sdkhooks>

public void OnPluginStart()
{

    for(
int i 1<= MaxClientsi++)
    {
        if(
IsClientInGame(i)) OnClientPutInServer(i);
    }
}

public 
void OnClientPutInServer(int client)
{
    
SDKHookEx(clientSDKHook_OnTakeDamageAliveOnTakeDamageAlive);
}

public 
Action OnTakeDamageAlive(int victimintattackerintinflictorfloatdamageintdamagetype)
{

    static 
ConVar mp_friendlyfire;
    
    if(
mp_friendlyfire == null)
    {
        
mp_friendlyfire FindConVar("mp_friendlyfire");
        
        if(
mp_friendlyfire == nullSetFailState("There is no ConVar 'mp_friendlyfire'");
    }


    if(
damagetype == (DMG_SLASH|DMG_NEVERGIB) || damagetype == (DMG_SHOCK|DMG_NEVERGIB))
    {
        if( 
mp_friendlyfire.BoolValue && GetClientTeam(attacker) == GetClientTeam(victim) ) return Plugin_Handled;
    }
    
    return 
Plugin_Continue;

__________________
Do not Private Message @me
Bacardi is offline
thekings4fun
Member
Join Date: Apr 2020
Old 04-15-2020 , 16:17   Re: remove knife and teaser damage
Reply With Quote #3

thank you very much, removed the knife and teaser damage, but now he is kicking out the players, who try to stab their teammates, how do I resolve this?
thekings4fun is offline
thekings4fun
Member
Join Date: Apr 2020
Old 04-15-2020 , 16:28   Re: remove knife and teaser damage
Reply With Quote #4

in addition to expelling he is banning players for a period of time
thekings4fun is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-15-2020 , 17:06   Re: remove knife and teaser damage
Reply With Quote #5

Could this help.
Code:
"mp_autokick" = "0" ( def. "1" )
FCVAR_GAMEDLL FCVAR_REPLICATED FCVAR_RELEASE 
- Kick idle/team-killing/team-damaging players
// kick, no ban
sv_kick_ban_duration 0
Bacardi is offline
thekings4fun
Member
Join Date: Apr 2020
Old 04-15-2020 , 17:59   Re: remove knife and teaser damage
Reply With Quote #6

Quote:
Originally Posted by Bacardi View Post
Could this help.
Code:
"mp_autokick" = "0" ( def. "1" )
FCVAR_GAMEDLL FCVAR_REPLICATED FCVAR_RELEASE 
- Kick idle/team-killing/team-damaging players
// kick, no ban
sv_kick_ban_duration 0
ok thanks
thekings4fun 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 04:34.


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