AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [CS:GO] Friendly Fire Damage (https://forums.alliedmods.net/showthread.php?t=321173)

Ilusion9 01-28-2020 08:29

[CS:GO] Friendly Fire Damage
 
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

Ejziponken 01-28-2020 09:39

Re: [CS:GO] Molotov Damage
 
How is this different from: https://forums.alliedmods.net/showthread.php?t=320656 ?

Ilusion9 01-28-2020 09:40

Re: [CS:GO] Molotov Damage
 
Quote:

Originally Posted by Ejziponken (Post 2681956)

It's still made, changed and tested by me, but I will give support here.

kkkfs 06-08-2020 09:22

Re: [CS:GO] Molotov Friendly Fire
 
i cant use the ff_ convars after i use the plungins,is it normal?

kkkfs 06-08-2020 09:24

Re: [CS:GO] Molotov Friendly Fire
 
Quote:

Originally Posted by kkkfs (Post 2704616)
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

paulo_crash 07-16-2020 20:38

Re: [CS:GO] Molotov Friendly Fire
 
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.

flashing 07-24-2020 05:12

Re: [CS:GO] Molotov Friendly Fire
 
after today's update knife damage is now enabled

borzaka 07-24-2020 10:42

Re: [CS:GO] Molotov Friendly Fire
 
Quote:

Originally Posted by flashing (Post 2711414)
after today's update knife damage is now enabled

Update your SourceMod to the latest stable:
https://www.sourcemod.net/downloads.php?branch=stable

flashing 07-24-2020 11:16

Re: [CS:GO] Molotov Friendly Fire
 
Quote:

Originally Posted by borzaka (Post 2711485)
Update your SourceMod to the latest stable:
https://www.sourcemod.net/downloads.php?branch=stable

yup just figured it out thanks

penalte 07-24-2020 14:18

Re: [CS:GO] Molotov Friendly Fire
 
Quote:

Originally Posted by paulo_crash (Post 2710429)
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;




All times are GMT -4. The time now is 12:57.

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