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

[CS:GO] Blocking Friendly Fire, Enable Molotov/Ince damage for Retakes/5v5


Post New Thread Reply   
 
Thread Tools Display Modes
Author
abhishek_deshkar
Senior Member
Join Date: Jun 2013
Location: Earth
Plugin ID:
6879
Plugin Version:
1.6
Plugin Category:
General Purpose
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Old 01-02-2020 , 04:18   [CS:GO] Blocking Friendly Fire, Enable Molotov/Ince damage for Retakes/5v5
    Reply With Quote #1

    This plugin blocks Friendlyfire but enables incendiary/molotove damage to teammates. You might want to use this plugin for retakes.

    NOTE: You don't need to change/set cvars to enable this plugin.

    Installation
    1. Download and compile the latest source.
    2. Place .smx in addons/sourcemod/plugins

    After installation, teammates will take only molotov/incendiary damage.
    Attached Files
    File Type: sp Get Plugin or Get Source (ff_enable_molotov.sp - 943 views - 1.1 KB)

    Last edited by abhishek_deshkar; 01-02-2020 at 23:20.
    abhishek_deshkar is offline
    pandd
    Junior Member
    Join Date: Aug 2019
    Old 01-02-2020 , 06:07   Re: [CS:GO] Blocking Friendly Fire, Enable Molotov/Ince damage for Retakes/5v5
    Reply With Quote #2

    C4 is harmless and unbalanced
    pandd is offline
    abhishek_deshkar
    Senior Member
    Join Date: Jun 2013
    Location: Earth
    Old 01-02-2020 , 08:41   Re: [CS:GO] Blocking Friendly Fire, Enable Molotov/Ince damage for Retakes/5v5
    Reply With Quote #3

    Quote:
    Originally Posted by pandd View Post
    C4 is harmless and unbalanced
    Fixed C4 damage. Please let me know if you find any bug.
    abhishek_deshkar is offline
    Ilusion9
    Veteran Member
    Join Date: Jun 2018
    Location: Romania
    Old 01-02-2020 , 12:03   Re: [CS:GO] Blocking Friendly Fire, Enable Molotov/Ince damage for Retakes/5v5
    Reply With Quote #4

    Never send a command in OnPluginStart function.

    PHP Code:

    #include <sourcemod>
    #include <sdkhooks>

    public Plugin myinfo = {
        
    name "Enable FF Molotov/Inc only Damage",
        
    author "Abhishek Deshkar",
        
    description "This plugin blocks Friendlyfire but enables incendiary/molotove damage to teammates.",
        
    version "1.6",
        
    url "https://www.facebook.com/abhi.pro"
    };

    ConVar g_Cvar_FriendlyFire;

    public 
    void OnPluginStart()
    {
        
    g_Cvar_FriendlyFire FindConVar("mp_friendlyfire");
    }

    public 
    void OnConfigsExecured()
    {
        
    g_Cvar_FriendlyFire.SetInt(1);
    }

    public 
    OnClientPutInServer(client)
    {
        
    SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage);
    }

    public 
    Action OnTakeDamage(int victimint &attackerint &inflictorfloat &damageint &damagetypeint &weaponfloat damageForce[3], float damagePosition[3])
    {
        if (
    attacker || attacker MaxClients || attacker == victim || attacker == inflictor || weapon 1)
        {
            return 
    Plugin_Continue;
        }
        
        if (
    GetClientTeam(victim) == GetClientTeam(attacker))
        {
            return 
    Plugin_Handled;
        }
        
        return 
    Plugin_Continue;

    Try this, I've simplified your code.
    __________________
    Ilusion9 is offline
    abhishek_deshkar
    Senior Member
    Join Date: Jun 2013
    Location: Earth
    Old 01-02-2020 , 23:19   Re: [CS:GO] Blocking Friendly Fire, Enable Molotov/Ince damage for Retakes/5v5
    Reply With Quote #5

    Quote:
    Originally Posted by Ilusion9 View Post
    Never send a command in OnPluginStart function.

    PHP Code:

    #include <sourcemod>
    #include <sdkhooks>

    public Plugin myinfo = {
        
    name "Enable FF Molotov/Inc only Damage",
        
    author "Abhishek Deshkar",
        
    description "This plugin blocks Friendlyfire but enables incendiary/molotove damage to teammates.",
        
    version "1.6",
        
    url "https://www.facebook.com/abhi.pro"
    };

    ConVar g_Cvar_FriendlyFire;

    public 
    void OnPluginStart()
    {
        
    g_Cvar_FriendlyFire FindConVar("mp_friendlyfire");
    }

    public 
    void OnConfigsExecured()
    {
        
    g_Cvar_FriendlyFire.SetInt(1);
    }

    public 
    OnClientPutInServer(client)
    {
        
    SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage);
    }

    public 
    Action OnTakeDamage(int victimint &attackerint &inflictorfloat &damageint &damagetypeint &weaponfloat damageForce[3], float damagePosition[3])
    {
        if (
    attacker || attacker MaxClients || attacker == victim || attacker == inflictor || weapon 1)
        {
            return 
    Plugin_Continue;
        }
        
        if (
    GetClientTeam(victim) == GetClientTeam(attacker))
        {
            return 
    Plugin_Handled;
        }
        
        return 
    Plugin_Continue;

    Try this, I've simplified your code.

    Thanks for the optimizing plugin. I've updated it.
    abhishek_deshkar is offline
    GTAmama16
    Member
    Join Date: Jun 2019
    Old 01-04-2020 , 04:10   Re: [CS:GO] Blocking Friendly Fire, Enable Molotov/Ince damage for Retakes/5v5
    Reply With Quote #6

    weird, im still not taking dmg from a friendly molotov, do i need to set the mp_friendlyfire to 1 in the server.cfg?
    GTAmama16 is offline
    Ilusion9
    Veteran Member
    Join Date: Jun 2018
    Location: Romania
    Old 01-04-2020 , 06:50   Re: [CS:GO] Blocking Friendly Fire, Enable Molotov/Ince damage for Retakes/5v5
    Reply With Quote #7

    Quote:
    Originally Posted by GTAmama16 View Post
    weird, im still not taking dmg from a friendly molotov, do i need to set the mp_friendlyfire to 1 in the server.cfg?
    No.
    I haven't tested this plugin, but maybe the condition (attacker == inflictor) it's not enough to check if the damage was done by a molotov.
    __________________
    Ilusion9 is offline
    GTAmama16
    Member
    Join Date: Jun 2019
    Old 01-04-2020 , 08:43   Re: [CS:GO] Blocking Friendly Fire, Enable Molotov/Ince damage for Retakes/5v5
    Reply With Quote #8

    Quote:
    Originally Posted by Ilusion9 View Post
    No.
    I haven't tested this plugin, but maybe the condition (attacker == inflictor) it's not enough to check if the damage was done by a molotov.
    yeah i have tried both FF on 1 and 0, the plugin is not working, no error msg showed either
    GTAmama16 is offline
    Ejziponken
    AlliedModders Donor
    Join Date: Apr 2008
    Old 01-04-2020 , 21:05   Re: [CS:GO] Blocking Friendly Fire, Enable Molotov/Ince damage for Retakes/5v5
    Reply With Quote #9

    Gah, this is the 3rd plugin I test for this and none of them working (I havent confirmed the one in this thread tho, just reading the comments).
    Ejziponken is offline
    Ilusion9
    Veteran Member
    Join Date: Jun 2018
    Location: Romania
    Old 01-05-2020 , 09:04   Re: [CS:GO] Blocking Friendly Fire, Enable Molotov/Ince damage for Retakes/5v5
    Reply With Quote #10

    Even with friendlyfire on 1, you must set ff_ cvars right:

    PHP Code:

    mp_friendlyfire 1
    ff_damage_reduction_bullets 0.33
    ff_damage_reduction_grenade 0.85
    ff_damage_reduction_grenade_self 1
    ff_damage_reduction_other 0.4 
    Plugin tested and works correctly:
    PHP Code:
    #include <sourcemod>
    #include <sdkhooks>

    public OnClientPutInServer(client)
    {
        
    SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage);
    }

    public 
    Action OnTakeDamage(int victimint &attackerint &inflictorfloat &damageint &damagetypeint &weaponfloat damageForce[3], float damagePosition[3])
    {
        
    // Invalid attacker or self damage
        
    if (attacker || attacker MaxClients || attacker == victim || inflictor 1)
        {
            return 
    Plugin_Continue;
        }
        
        
    // Frienly fire
        
    if (GetClientTeam(attacker) == GetClientTeam(victim))
        {
            
    char inflictorClass[64];
            if (
    GetEdictClassname(inflictorinflictorClasssizeof(inflictorClass)))
            {
                
    // C4 damage
                
    if (StrEqual(inflictorClass"planted_c4"))
                {
                    return 
    Plugin_Continue;
                }
                
                
    // Incendiary damage
                
    if (StrEqual(inflictorClass"inferno"))
                {
                    return 
    Plugin_Continue;
                }
            }
            
            return 
    Plugin_Handled;
        }
        
        return 
    Plugin_Continue;

    Also, you should check mp_tkpunish and mp_autokick cvars.
    __________________

    Last edited by Ilusion9; 01-05-2020 at 11:26.
    Ilusion9 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 07:50.


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