Raised This Month: $350 Target: $400
 87%   Almost there!

[CS:GO] Friendly Fire Damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Plugin ID:
6923
Plugin Version:
Plugin Category:
General Purpose
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Manage the damage done to teammates.
    Old 01-28-2020 , 08:29   [CS:GO] Friendly Fire Damage
    Reply With Quote #1

    Description: Manage the damage done to teammates.

    Required ConVars:
    Code:
    mp_friendlyfire 1
    Plugin ConVars:
    Code:
    sm_ff_damage_reduction_hegrenade 1.0 - Damage done to teammates by a thrown hegrenade. 
    sm_ff_damage_reduction_hegrenade_self 1.0 - Damage done to players by their own hegrenade.
    sm_ff_damage_reduction_molotov 1.0 - Damage done to teammates by a thrown molotov.
    sm_ff_damage_reduction_molotov_self 1.0 - Damage done to players by their own molotov.
    sm_ff_damage_reduction_knife 1.0 - Damage done to teammates by a knife.
    sm_ff_damage_reduction_taser 1.0 - Damage done to teammates by a taser.
    sm_ff_damage_reduction_other 1.0 - Damage done to teammates by other things.
    Other CS:GO ConVars available:
    Code:
    ff_damage_bullet_penetration
    ff_damage_reduction_bullets
    ff_damage_decoy_explosion
    ff_damage_grenade_hit
    Useless CS:GO ConVars with this plugin:
    Code:
    ff_damage_reduction_grenade
    ff_damage_reduction_grenade_self
    ff_damage_reduction_other
    GitHub: https://github.com/Ilusion9/csgo-ff-damage-sm
    __________________

    Last edited by Ilusion9; 05-16-2021 at 13:56.
    Ilusion9 is offline
    Ejziponken
    AlliedModders Donor
    Join Date: Apr 2008
    Old 01-28-2020 , 09:39   Re: [CS:GO] Molotov Damage
    Reply With Quote #2

    How is this different from: https://forums.alliedmods.net/showthread.php?t=320656 ?
    Ejziponken is online now
    Ilusion9
    Veteran Member
    Join Date: Jun 2018
    Location: Romania
    Old 01-28-2020 , 09:40   Re: [CS:GO] Molotov Damage
    Reply With Quote #3

    Quote:
    Originally Posted by Ejziponken View Post
    It's still made, changed and tested by me, but I will give support here.
    __________________

    Last edited by Ilusion9; 01-28-2020 at 09:41.
    Ilusion9 is offline
    kkkfs
    New Member
    Join Date: May 2020
    Old 06-08-2020 , 09:22   Re: [CS:GO] Molotov Friendly Fire
    Reply With Quote #4

    i cant use the ff_ convars after i use the plungins,is it normal?
    kkkfs is offline
    kkkfs
    New Member
    Join Date: May 2020
    Old 06-08-2020 , 09:24   Re: [CS:GO] Molotov Friendly Fire
    Reply With Quote #5

    Quote:
    Originally Posted by kkkfs View Post
    i cant use the ff_ convars after i use the plungins,is it normal?
    molotov can damage,but else cant damage teammate
    ff convars is useless
    kkkfs is offline
    paulo_crash
    AlliedModders Donor
    Join Date: May 2016
    Location: Brazil
    Old 07-16-2020 , 20:38   Re: [CS:GO] Molotov Friendly Fire
    Reply With Quote #6

    Does this include damage from all grenades? HE and Molotovs?

    In this case I would like to block all weapon fire damage, except for grenades, be it HE or Molotovs.
    paulo_crash is offline
    flashing
    Senior Member
    Join Date: Jul 2019
    Location: Delhi, India
    Old 07-24-2020 , 05:12   Re: [CS:GO] Molotov Friendly Fire
    Reply With Quote #7

    after today's update knife damage is now enabled
    __________________

            Discord: FLASHING#8548
                  Steam
    flashing is offline
    borzaka
    AlliedModders Donor
    Join Date: May 2020
    Location: Hungary
    Old 07-24-2020 , 10:42   Re: [CS:GO] Molotov Friendly Fire
    Reply With Quote #8

    Quote:
    Originally Posted by flashing View Post
    after today's update knife damage is now enabled
    Update your SourceMod to the latest stable:
    https://www.sourcemod.net/downloads.php?branch=stable
    borzaka is offline
    flashing
    Senior Member
    Join Date: Jul 2019
    Location: Delhi, India
    Old 07-24-2020 , 11:16   Re: [CS:GO] Molotov Friendly Fire
    Reply With Quote #9

    Quote:
    Originally Posted by borzaka View Post
    Update your SourceMod to the latest stable:
    https://www.sourcemod.net/downloads.php?branch=stable
    yup just figured it out thanks
    __________________

            Discord: FLASHING#8548
                  Steam
    flashing is offline
    penalte
    Member
    Join Date: Jan 2016
    Old 07-24-2020 , 14:18   Re: [CS:GO] Molotov Friendly Fire
    Reply With Quote #10

    Quote:
    Originally Posted by paulo_crash View Post
    Does this include damage from all grenades? HE and Molotovs?

    In this case I would like to block all weapon fire damage, except for grenades, be it HE or Molotovs.
    Here it is with HE GRENADE added

    PHP Code:
    #include <sourcemod>
    #include <sdkhooks>
    #pragma newdecls required

    public Plugin myinfo =
    {
        
    name "Molotov Friendly Fire",
        
    author "Ilusion9",
        
    description "Enable only molotov damage for teammates and block everything else.",
        
    version "1.0",
        
    url "https://github.com/Ilusion9/"
    };

    bool g_IsPluginLoadedLate;

    public 
    APLRes AskPluginLoad2(Handle myselfbool latechar[] errorint err_max)
    {
        
    g_IsPluginLoadedLate late;
    }

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

    public 
    void OnClientPutInServer(int client)
    {
        
    SDKHook(clientSDKHook_OnTakeDamageSDK_OnTakeDamage);
    }

    public 
    Action SDK_OnTakeDamage(int victimint &attackerint &inflictorfloat &damageint &damagetypeint &weaponfloat damageForce[3], float damagePosition[3])
    {
        if (
    attacker || attacker MaxClients || attacker == victim || inflictor 1)
        {
            return 
    Plugin_Continue;
        }
        
        if (
    GetClientTeam(attacker) != GetClientTeam(victim))
        {
            return 
    Plugin_Continue;
        }
        
        if (
    inflictor MaxClients)
        {
            
    char inflictorClass[64];
            
    GetEdictClassname(inflictorinflictorClasssizeof(inflictorClass));
            
            if (
    StrEqual(inflictorClass"planted_c4") || StrEqual(inflictorClass"inferno") || StrEqual(inflictorClass"hegrenade_projectile"))
            {
                return 
    Plugin_Continue;
            }
        }
        
        
    damage 0.0;
        
    damagetype |= DMG_PREVENT_PHYSICS_FORCE;
        return 
    Plugin_Changed;

    penalte 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 16:00.


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