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

[CS:GO] Friendly Fire Damage


Post New Thread Reply   
 
Thread Tools Display Modes
thekings4fun
Member
Join Date: Apr 2020
Old 07-27-2020 , 09:41   Re: [CS:GO] Molotov Friendly Fire
Reply With Quote #11

it could remove the damage from the knife and zeus in the same code would help a lot, because with these settings above, the companions still continue to cause knife and zeus damage to their companions.
thekings4fun is offline
penalte
Member
Join Date: Jan 2016
Old 07-27-2020 , 19:04   Re: [CS:GO] Molotov Friendly Fire
Reply With Quote #12

Quote:
Originally Posted by thekings4fun View Post
it could remove the damage from the knife and zeus in the same code would help a lot, because with these settings above, the companions still continue to cause knife and zeus damage to their companions.
update sourcemod
penalte is offline
sakizao
Junior Member
Join Date: Jun 2020
Old 07-29-2020 , 11:07   Re: [CS:GO] Molotov Friendly Fire
Reply With Quote #13

Quote:
Originally Posted by penalte View Post
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;



does this plugin do this?

Plugin that blocks the friendlyfire through shots and knives but the damage with explosive grenades, flashes, molotovs must still give dmg to friendlyfire .. I just wanted my server to be like Most Pug servers, that actually implement a plugin that blocks friendlyfire on shots and knife attacks, but the rest continues doing damage on friendlyfire.

another question, what about ff_convars? with this plugin can i still set the amount of ff dmg done by the convars?

Last edited by sakizao; 07-29-2020 at 11:09.
sakizao is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 07-29-2020 , 15:48   Re: [CS:GO] Molotov Friendly Fire
Reply With Quote #14

Try this:
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);
    
SDKHook(clientSDKHook_TraceAttackSDK_OnTraceAttack);
}

public 
Action SDK_OnTakeDamage(int victimint &attackerint &inflictorfloat &damageint &damagetypeint &weaponfloat damageForce[3], float damagePosition[3])
{
    
// inflictor is not a grenade, world damage or enemy team
    
if (inflictor <= MaxClients || !IsValidClient(attacker) || GetClientTeam(attacker) != GetClientTeam(victim))
    {
        return 
Plugin_Continue;
    }
    
    
damage 0.0;
    
damagetype |= DMG_PREVENT_PHYSICS_FORCE;
    
    return 
Plugin_Changed;
}

public 
Action SDK_OnTraceAttack(int victimint &attackerint &inflictorfloat &damageint &damagetypeint &ammotypeint hitboxint hitgroup)
{
    
// world damage or enemy team
    
if (!IsValidClient(attacker) || GetClientTeam(attacker) != GetClientTeam(victim))
    {
        return 
Plugin_Continue;
    }
    
    return 
Plugin_Handled;
}

bool IsValidClient(int client)
{
    if (
client || client MaxClients || !IsClientInGame(client))
    {
        return 
false;
    }
    
    return 
true;

You can set the ff_ convars as you wish, but make sure the friendly fire is working
__________________

Last edited by Ilusion9; 07-29-2020 at 15:56.
Ilusion9 is offline
sakizao
Junior Member
Join Date: Jun 2020
Old 07-29-2020 , 20:42   Re: [CS:GO] Molotov Friendly Fire
Reply With Quote #15

Quote:
Originally Posted by Ilusion9 View Post
Try this:
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);
    
SDKHook(clientSDKHook_TraceAttackSDK_OnTraceAttack);
}

public 
Action SDK_OnTakeDamage(int victimint &attackerint &inflictorfloat &damageint &damagetypeint &weaponfloat damageForce[3], float damagePosition[3])
{
    
// inflictor is not a grenade, world damage or enemy team
    
if (inflictor <= MaxClients || !IsValidClient(attacker) || GetClientTeam(attacker) != GetClientTeam(victim))
    {
        return 
Plugin_Continue;
    }
    
    
damage 0.0;
    
damagetype |= DMG_PREVENT_PHYSICS_FORCE;
    
    return 
Plugin_Changed;
}

public 
Action SDK_OnTraceAttack(int victimint &attackerint &inflictorfloat &damageint &damagetypeint &ammotypeint hitboxint hitgroup)
{
    
// world damage or enemy team
    
if (!IsValidClient(attacker) || GetClientTeam(attacker) != GetClientTeam(victim))
    {
        return 
Plugin_Continue;
    }
    
    return 
Plugin_Handled;
}

bool IsValidClient(int client)
{
    if (
client || client MaxClients || !IsClientInGame(client))
    {
        return 
false;
    }
    
    return 
true;

You can set the ff_ convars as you wish, but make sure the friendly fire is working
It did not work, no friendlyfire at all, these were the convars I used..

mp_friendlyfire 1
ff_damage_bullet_penetration "0"
ff_damage_reduction_grenade 0.85
ff_damage_reduction_bullets "0"
ff_damage_reduction_other 1
ff_damage_reduction_grenade_self 1
sakizao is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 07-30-2020 , 04:54   Re: [CS:GO] Molotov Friendly Fire
Reply With Quote #16

Is ff working without my plugin? I think ff_damage_reduction_bullets should't be on 0.
__________________
Ilusion9 is offline
sakizao
Junior Member
Join Date: Jun 2020
Old 08-01-2020 , 19:46   Re: [CS:GO] Molotov Friendly Fire
Reply With Quote #17

Quote:
Originally Posted by Ilusion9 View Post
Is ff working without my plugin? I think ff_damage_reduction_bullets should't be on 0.
It actually does not matter, i updated sourcemod, and everything worked as expected.. If you throw a flash grenade into a teammate it should take "1hp" from damage as the flash hits the player.. so does Grenade and molotov.. If the actual grenade hits the player before exploding, it should give damage..

Anyway, the plugin is working fine as expected! i Thank you very much for the hard work done!

Im looking for someone that can implement this for my server..

(A pause plugin with time limitation. Basically, during the competitive game each team is restricted to 3 pauses of 1 minute duration. As soon as the pause time runs out, the freezetime automatically resumes and the game continues).

As we know by splewis the pugsetup only has a feature that pauses the match endlessly.. Actually on my servers, players abuse the use of pauses and I would like a plugin that resolves this issue.. is it possible? Im willing to pay if necessary..
sakizao is offline
paulo_crash
AlliedModders Donor
Join Date: May 2016
Location: Brazil
Old 08-01-2020 , 20:13   Re: [CS:GO] Molotov Friendly Fire
Reply With Quote #18

Quote:
Originally Posted by sakizao View Post
Im looking for someone that can implement this for my server..

(A pause plugin with time limitation. Basically, during the competitive game each team is restricted to 3 pauses of 1 minute duration. As soon as the pause time runs out, the freezetime automatically resumes and the game continues).

As we know by splewis the pugsetup only has a feature that pauses the match endlessly.. Actually on my servers, players abuse the use of pauses and I would like a plugin that resolves this issue.. is it possible? Im willing to pay if necessary..
WarMod [BFG] has this feature. Did he try?

Last edited by paulo_crash; 08-01-2020 at 20:14.
paulo_crash is offline
sakizao
Junior Member
Join Date: Jun 2020
Old 08-01-2020 , 20:21   Re: [CS:GO] Molotov Friendly Fire
Reply With Quote #19

Quote:
Originally Posted by paulo_crash View Post
WarMod [BFG] has this feature. Did he try?
Its actually easier to implement a plugin for the pause and just disable splewis pause setup on pugsetup config files than actually change the whole set of plugins that have been already updated and some features changed for my actual purpose.. That is the only issue i have on my servers, the rest is working just fine.

Regards
sakizao is offline
ROFI
New Member
Join Date: Aug 2020
Old 08-27-2020 , 11:08   Re: [CS:GO] Molotov Friendly Fire
Reply With Quote #20

Damage to molotov teammates does not work after the update.
ROFI 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 10:51.


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