Raised This Month: $222 Target: $400
 55% 

[CS:GO] Damage Mod


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Accelerator74
AlliedModders Donor
Join Date: Dec 2010
Location: Russia
Plugin ID:
4945
Plugin Version:
2.0
Plugin Category:
Gameplay
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Old 12-09-2015 , 23:28   [CS:GO] Damage Mod
    Reply With Quote #1

    Name: Damage Mod
    Version: 2.0
    Description: Simple plugin that adds a multiplier of damage to the weapons in the game (increases weapon damage).
    Attached Files
    File Type: sp Get Plugin or Get Source (csgo_damagemod.sp - 2640 views - 5.2 KB)

    Last edited by Accelerator74; 08-22-2016 at 04:20.
    Accelerator74 is offline
    Send a message via ICQ to Accelerator74
    Accelerator74
    AlliedModders Donor
    Join Date: Dec 2010
    Location: Russia
    Old 08-21-2016 , 11:22   Re: [CS:GO] Damage Mod
    Reply With Quote #2

    Updated to 2.0:
    * Optimization
    * Fixed weapons list
    Accelerator74 is offline
    Send a message via ICQ to Accelerator74
    zwetch
    Senior Member
    Join Date: Aug 2015
    Location: South Africa
    Old 03-24-2018 , 16:43   Re: [CS:GO] Damage Mod
    Reply With Quote #3

    anyway to make it so that we can select which weapons we would like to have more dmg.
    zwetch is offline
    Blue Malgeran
    Junior Member
    Join Date: Apr 2017
    Location: Israel
    Old 03-29-2018 , 02:04   Re: [CS:GO] Damage Mod
    Reply With Quote #4

    Quote:
    Originally Posted by zwetch View Post
    anyway to make it so that we can select which weapons we would like to have more dmg.
    Yes, you can change the damage by editing the .sp file and recompiling it.
    You need to change the numbers. Default number for each weapon is 1.0
    __________________

    Last edited by Blue Malgeran; 03-29-2018 at 02:17.
    Blue Malgeran is offline
    plock
    Senior Member
    Join Date: Feb 2016
    Location: noitacoL
    Old 03-29-2018 , 08:41   Re: [CS:GO] Damage Mod
    Reply With Quote #5

    Quote:
    Originally Posted by zwetch View Post
    anyway to make it so that we can select which weapons we would like to have more dmg.
    Quote:
    Originally Posted by Blue Malgeran View Post
    Yes, you can change the damage by editing the .sp file and recompiling it.
    You need to change the numbers. Default number for each weapon is 1.0
    You don't need to recompile it. It should generate a cfg file with all the cvars, if not, just add the cvar to your server cfg file with the number you want. If it doesn't generate the .cfg inside cfg/sourcemod, you should open the .sp and look for the cvar name for each weapon and copy to your server.cfg.
    __________________
    ~tuturu

    Owner/Developer at Kniv
    My Steam Profile
    plock is offline
    rEDGUY
    Junior Member
    Join Date: Dec 2018
    Old 05-18-2019 , 08:51   Re: [CS:GO] Damage Mod
    Reply With Quote #6

    Hey, awesome plugin but it would be nice if u could lock it to specific flags
    rEDGUY is offline
    paulo_crash
    AlliedModders Donor
    Join Date: May 2016
    Location: Brazil
    Old 01-25-2020 , 14:14   Re: [CS:GO] Damage Mod
    Reply With Quote #7

    Thanks for sharing.

    Quote:
    Originally Posted by rEDGUY View Post
    Hey, awesome plugin but it would be nice if u could lock it to specific flags
    Same thing, did anyone manage to make a version that only privileged players have this feature for them?
    __________________
    paulo_crash is offline
    Cruze
    Veteran Member
    Join Date: May 2017
    Old 01-27-2020 , 11:27   Re: [CS:GO] Damage Mod
    Reply With Quote #8

    PHP Code:
    #include <sourcemod>
    #include <sdkhooks>

    enum WpnID {
        
    wpn_none,
        
    ConVar:wpn_ak47,
        
    ConVar:wpn_aug,
        
    ConVar:wpn_awp,
        
    ConVar:wpn_bizon,
        
    ConVar:wpn_deagle,
        
    ConVar:wpn_elite,
        
    ConVar:wpn_famas,
        
    ConVar:wpn_fiveseven,
        
    ConVar:wpn_g3sg1,
        
    ConVar:wpn_galilar,
        
    ConVar:wpn_glock,
        
    ConVar:wpn_hkp2000,
        
    ConVar:wpn_knife,
        
    ConVar:wpn_m249,
        
    ConVar:wpn_m4a1,
        
    ConVar:wpn_mac10,
        
    ConVar:wpn_mag7,
        
    ConVar:wpn_mp7,
        
    ConVar:wpn_mp9,
        
    ConVar:wpn_negev,
        
    ConVar:wpn_nova,
        
    ConVar:wpn_p250,
        
    ConVar:wpn_p90,
        
    ConVar:wpn_sawedoff,
        
    ConVar:wpn_scar20,
        
    ConVar:wpn_sg556,
        
    ConVar:wpn_ssg08,
        
    ConVar:wpn_tec9,
        
    ConVar:wpn_ump45,
        
    ConVar:wpn_xm1014
    };

    ConVar wpn_damage[WpnID], wpn_damage_flag;
    float wpn_damage_value[WpnID];

    char WeaponClassname[WpnID][] = {
        
    """weapon_ak47""weapon_aug""weapon_awp""weapon_bizon""weapon_deagle""weapon_elite""weapon_famas""weapon_fiveseven""weapon_g3sg1""weapon_galilar""weapon_glock""weapon_hkp2000""weapon_knife""weapon_m249""weapon_m4a1""weapon_mac10""weapon_mag7""weapon_mp7""weapon_mp9""weapon_negev""weapon_nova""weapon_p250""weapon_p90""weapon_sawedoff""weapon_scar20""weapon_sg556""weapon_ssg08""weapon_tec9""weapon_ump45""weapon_xm1014"
    };

    Handle hWeaponClassTrie INVALID_HANDLE;

    stock void InitWeaponClassTrie()
    {
        
    hWeaponClassTrie CreateTrie();
        for(
    int i 0view_as<int>(WpnID); i++)
        {
            
    SetTrieValue(hWeaponClassTrieWeaponClassname[view_as<WpnID>(i)], i);
        }
    }

    stock WpnID WeaponClassToId(const char[] weaponClass)
    {
        
    WpnID id;
        if(
    hWeaponClassTrie == INVALID_HANDLE)
        {
            
    InitWeaponClassTrie();
        }
        if(
    GetTrieValue(hWeaponClassTrieweaponClassid))
        {
            return 
    view_as<WpnID>(id);
        }
        return 
    wpn_none;
    }

    public 
    Plugin myinfo =
    {
        
    name "CS:GO Weapons Damage Mod",
        
    author "Accelerator",
        
    description "",
        
    version "2.1",
        
    url "http://core-ss.org"
    };

    public 
    void OnPluginStart()
    {
        
    wpn_damage[wpn_ak47] = CreateConVar("damage_ak47""1.0");
        
    wpn_damage[wpn_aug] = CreateConVar("damage_aug""1.0");
        
    wpn_damage[wpn_awp] = CreateConVar("damage_awp""1.0");
        
    wpn_damage[wpn_bizon] = CreateConVar("damage_bizon""1.0");
        
    wpn_damage[wpn_deagle] = CreateConVar("damage_deagle""1.0""Deagle and Revolver");
        
    wpn_damage[wpn_elite] = CreateConVar("damage_elite""1.0");
        
    wpn_damage[wpn_famas] = CreateConVar("damage_famas""1.0");
        
    wpn_damage[wpn_fiveseven] = CreateConVar("damage_fiveseven""1.0");
        
    wpn_damage[wpn_g3sg1] = CreateConVar("damage_g3sg1""1.0");
        
    wpn_damage[wpn_galilar] = CreateConVar("damage_galilar""1.0");
        
    wpn_damage[wpn_glock] = CreateConVar("damage_glock""1.0");
        
    wpn_damage[wpn_hkp2000] = CreateConVar("damage_hkp2000""1.0""HKP2000 and USP Silencer");
        
    wpn_damage[wpn_knife] = CreateConVar("damage_knife""1.0");
        
    wpn_damage[wpn_m249] = CreateConVar("damage_m249""1.0");
        
    wpn_damage[wpn_m4a1] = CreateConVar("damage_m4a1""1.0""M4A1 and M4A1 Silencer");
        
    wpn_damage[wpn_mac10] = CreateConVar("damage_mac10""1.0");
        
    wpn_damage[wpn_mag7] = CreateConVar("damage_mag7""1.0");
        
    wpn_damage[wpn_mp7] = CreateConVar("damage_mp7""1.0");
        
    wpn_damage[wpn_mp9] = CreateConVar("damage_mp9""1.0");
        
    wpn_damage[wpn_negev] = CreateConVar("damage_negev""1.0");
        
    wpn_damage[wpn_nova] = CreateConVar("damage_nova""1.0");
        
    wpn_damage[wpn_p250] = CreateConVar("damage_p250""1.0""P250 and CZ75A");
        
    wpn_damage[wpn_p90] = CreateConVar("damage_p90""1.0");
        
    wpn_damage[wpn_sawedoff] = CreateConVar("damage_sawedoff""1.0");
        
    wpn_damage[wpn_scar20] = CreateConVar("damage_scar20""1.0");
        
    wpn_damage[wpn_sg556] = CreateConVar("damage_sg556""1.0");
        
    wpn_damage[wpn_ssg08] = CreateConVar("damage_ssg08""1.0");
        
    wpn_damage[wpn_tec9] = CreateConVar("damage_tec9""1.0");
        
    wpn_damage[wpn_ump45] = CreateConVar("damage_ump45""1.0");
        
    wpn_damage[wpn_xm1014] = CreateConVar("damage_xm1014""1.0");
        
    wpn_damage_flag CreateConVar("damage_flag""a");
        
        for (
    int i 1<= MaxClientsi++)
        {
            if (
    IsClientInGame(i))
                
    OnClientPutInServer(i);
        }
        for(
    int i 1view_as<int>(WpnID); i++)
        {
            
    wpn_damage_value[i] = wpn_damage[i].FloatValue;
            
    HookConVarChange(wpn_damage[i], OnConVarDamageChange);
        }
        
    AutoExecConfig(true"damagemod");
    }

    public 
    void OnConVarDamageChange(ConVar cvar, const char[] oldVal, const char[] newVal)
    {
        if (
    StringToFloat(newVal) == StringToFloat(oldVal))
            return;
        
        for(
    int i 1view_as<int>(WpnID); i++)
        {
            if (
    cvar == wpn_damage[i])
            {
                
    wpn_damage_value[i] = wpn_damage[i].FloatValue;
            }
        }
    }

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

    public 
    Action OnTakeDamage(int victimint &attackerint &inflictorfloat &damageint &damagetypeint &weaponfloat damageForce[3], float damagePosition[3])
    {
        
    char sBuffer[5];
        
    wpn_damage_flag.GetString(sBuffersizeof(sBuffer));
        
        if (
    damage <= 0.0 || victim || victim MaxClients || attacker || attacker MaxClients)
            return 
    Plugin_Continue;
        
        if (!
    IsValidEdict(weapon))
            return 
    Plugin_Continue;
        
        if(!
    CheckAdminFlags(attackerReadFlagString(sBuffer)))
            return 
    Plugin_Continue;
        
        
    char clsname[32];
        
    GetEdictClassname(weaponclsnamesizeof(clsname));
        
        
    WpnID WeaponId;
        if ((
    WeaponId WeaponClassToId(clsname)) != wpn_none)
        {
            
    damage *= wpn_damage_value[WeaponId];
            return 
    Plugin_Changed;
        }
        
        return 
    Plugin_Continue;
    }

    bool CheckAdminFlags(int clientint iFlag)
    {
        
    int iUserFlags GetUserFlagBits(client);
        return (
    iUserFlags ADMFLAG_ROOT || (iUserFlags iFlag) == iFlag);

    Untested.
    __________________
    Taking paid private requests! Add me on steam/discord!
    AlliedModders Releases | Github | Private Plugins | PayPal | Steam | My Discord Server

    Last edited by Cruze; 01-27-2020 at 11:33. Reason: whoops.
    Cruze is offline
    paulo_crash
    AlliedModders Donor
    Join Date: May 2016
    Location: Brazil
    Old 01-27-2020 , 11:34   Re: [CS:GO] Damage Mod
    Reply With Quote #9

    Quote:
    Originally Posted by Cruze View Post
    PHP Code:
    #include <sourcemod>
    #include <sdkhooks>

    enum WpnID {
        
    wpn_none,
        
    ConVar:wpn_ak47,
        
    ConVar:wpn_aug,
        
    ConVar:wpn_awp,
        
    ConVar:wpn_bizon,
        
    ConVar:wpn_deagle,
        
    ConVar:wpn_elite,
        
    ConVar:wpn_famas,
        
    ConVar:wpn_fiveseven,
        
    ConVar:wpn_g3sg1,
        
    ConVar:wpn_galilar,
        
    ConVar:wpn_glock,
        
    ConVar:wpn_hkp2000,
        
    ConVar:wpn_knife,
        
    ConVar:wpn_m249,
        
    ConVar:wpn_m4a1,
        
    ConVar:wpn_mac10,
        
    ConVar:wpn_mag7,
        
    ConVar:wpn_mp7,
        
    ConVar:wpn_mp9,
        
    ConVar:wpn_negev,
        
    ConVar:wpn_nova,
        
    ConVar:wpn_p250,
        
    ConVar:wpn_p90,
        
    ConVar:wpn_sawedoff,
        
    ConVar:wpn_scar20,
        
    ConVar:wpn_sg556,
        
    ConVar:wpn_ssg08,
        
    ConVar:wpn_tec9,
        
    ConVar:wpn_ump45,
        
    ConVar:wpn_xm1014
    };

    ConVar wpn_damage[WpnID], wpn_damage_flag;
    float wpn_damage_value[WpnID];

    char WeaponClassname[WpnID][] = {
        
    """weapon_ak47""weapon_aug""weapon_awp""weapon_bizon""weapon_deagle""weapon_elite""weapon_famas""weapon_fiveseven""weapon_g3sg1""weapon_galilar""weapon_glock""weapon_hkp2000""weapon_knife""weapon_m249""weapon_m4a1""weapon_mac10""weapon_mag7""weapon_mp7""weapon_mp9""weapon_negev""weapon_nova""weapon_p250""weapon_p90""weapon_sawedoff""weapon_scar20""weapon_sg556""weapon_ssg08""weapon_tec9""weapon_ump45""weapon_xm1014"
    };

    Handle hWeaponClassTrie INVALID_HANDLE;

    stock void InitWeaponClassTrie()
    {
        
    hWeaponClassTrie CreateTrie();
        for(
    int i 0view_as<int>(WpnID); i++)
        {
            
    SetTrieValue(hWeaponClassTrieWeaponClassname[view_as<WpnID>(i)], i);
        }
    }

    stock WpnID WeaponClassToId(const char[] weaponClass)
    {
        
    WpnID id;
        if(
    hWeaponClassTrie == INVALID_HANDLE)
        {
            
    InitWeaponClassTrie();
        }
        if(
    GetTrieValue(hWeaponClassTrieweaponClassid))
        {
            return 
    view_as<WpnID>(id);
        }
        return 
    wpn_none;
    }

    public 
    Plugin myinfo =
    {
        
    name "CS:GO Weapons Damage Mod",
        
    author "Accelerator",
        
    description "",
        
    version "2.1",
        
    url "http://core-ss.org"
    };

    public 
    void OnPluginStart()
    {
        
    wpn_damage[wpn_ak47] = CreateConVar("damage_ak47""1.0");
        
    wpn_damage[wpn_aug] = CreateConVar("damage_aug""1.0");
        
    wpn_damage[wpn_awp] = CreateConVar("damage_awp""1.0");
        
    wpn_damage[wpn_bizon] = CreateConVar("damage_bizon""1.0");
        
    wpn_damage[wpn_deagle] = CreateConVar("damage_deagle""1.0""Deagle and Revolver");
        
    wpn_damage[wpn_elite] = CreateConVar("damage_elite""1.0");
        
    wpn_damage[wpn_famas] = CreateConVar("damage_famas""1.0");
        
    wpn_damage[wpn_fiveseven] = CreateConVar("damage_fiveseven""1.0");
        
    wpn_damage[wpn_g3sg1] = CreateConVar("damage_g3sg1""1.0");
        
    wpn_damage[wpn_galilar] = CreateConVar("damage_galilar""1.0");
        
    wpn_damage[wpn_glock] = CreateConVar("damage_glock""1.0");
        
    wpn_damage[wpn_hkp2000] = CreateConVar("damage_hkp2000""1.0""HKP2000 and USP Silencer");
        
    wpn_damage[wpn_knife] = CreateConVar("damage_knife""1.0");
        
    wpn_damage[wpn_m249] = CreateConVar("damage_m249""1.0");
        
    wpn_damage[wpn_m4a1] = CreateConVar("damage_m4a1""1.0""M4A1 and M4A1 Silencer");
        
    wpn_damage[wpn_mac10] = CreateConVar("damage_mac10""1.0");
        
    wpn_damage[wpn_mag7] = CreateConVar("damage_mag7""1.0");
        
    wpn_damage[wpn_mp7] = CreateConVar("damage_mp7""1.0");
        
    wpn_damage[wpn_mp9] = CreateConVar("damage_mp9""1.0");
        
    wpn_damage[wpn_negev] = CreateConVar("damage_negev""1.0");
        
    wpn_damage[wpn_nova] = CreateConVar("damage_nova""1.0");
        
    wpn_damage[wpn_p250] = CreateConVar("damage_p250""1.0""P250 and CZ75A");
        
    wpn_damage[wpn_p90] = CreateConVar("damage_p90""1.0");
        
    wpn_damage[wpn_sawedoff] = CreateConVar("damage_sawedoff""1.0");
        
    wpn_damage[wpn_scar20] = CreateConVar("damage_scar20""1.0");
        
    wpn_damage[wpn_sg556] = CreateConVar("damage_sg556""1.0");
        
    wpn_damage[wpn_ssg08] = CreateConVar("damage_ssg08""1.0");
        
    wpn_damage[wpn_tec9] = CreateConVar("damage_tec9""1.0");
        
    wpn_damage[wpn_ump45] = CreateConVar("damage_ump45""1.0");
        
    wpn_damage[wpn_xm1014] = CreateConVar("damage_xm1014""1.0");
        
    wpn_damage_flag CreateConVar("damage_flag""a");
        
        for (
    int i 1<= MaxClientsi++)
        {
            if (
    IsClientInGame(i))
                
    OnClientPostAdminCheck(i);
        }
        for(
    int i 1view_as<int>(WpnID); i++)
        {
            
    wpn_damage_value[i] = wpn_damage[i].FloatValue;
            
    HookConVarChange(wpn_damage[i], OnConVarDamageChange);
        }
        
    AutoExecConfig(true"damagemod");
    }

    public 
    void OnConVarDamageChange(ConVar cvar, const char[] oldVal, const char[] newVal)
    {
        if (
    StringToFloat(newVal) == StringToFloat(oldVal))
            return;
        
        for(
    int i 1view_as<int>(WpnID); i++)
        {
            if (
    cvar == wpn_damage[i])
            {
                
    wpn_damage_value[i] = wpn_damage[i].FloatValue;
            }
        }
    }

    public 
    void OnClientPostAdminCheck(int client)
    {
        
    SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage);
    }

    public 
    Action OnTakeDamage(int victimint &attackerint &inflictorfloat &damageint &damagetypeint &weaponfloat damageForce[3], float damagePosition[3])
    {
        
    char sBuffer[5];
        
    wpn_damage_flag.GetString(sBuffersizeof(sBuffer));
        
        if (
    damage <= 0.0 || victim || victim MaxClients || attacker || attacker MaxClients)
            return 
    Plugin_Continue;
        
        if (!
    IsValidEdict(weapon))
            return 
    Plugin_Continue;
        
        if(!
    CheckAdminFlags(attackerReadFlagString(sBuffer)))
            return 
    Plugin_Continue;
        
        
    char clsname[32];
        
    GetEdictClassname(weaponclsnamesizeof(clsname));
        
        
    WpnID WeaponId;
        if ((
    WeaponId WeaponClassToId(clsname)) != wpn_none)
        {
            
    damage *= wpn_damage_value[WeaponId];
            return 
    Plugin_Changed;
        }
        
        return 
    Plugin_Continue;
    }

    bool CheckAdminFlags(int clientint iFlag)
    {
        
    int iUserFlags GetUserFlagBits(client);
        return (
    iUserFlags ADMFLAG_ROOT || (iUserFlags iFlag) == iFlag);

    Untested.
    Thank you, I will test.

    This one would only work with those who have the ADMFLAG_ROOT flag, if I want to change it, just change it in the source code, right?

    [EDIT1]
    Sorry, I saw you added a new cvar for control, thanks.
    __________________

    Last edited by paulo_crash; 01-27-2020 at 11:38. Reason: Sorry, I saw you added a new cvar for control, thanks.
    paulo_crash is offline
    Cruze
    Veteran Member
    Join Date: May 2017
    Old 01-27-2020 , 11:39   Re: [CS:GO] Damage Mod
    Reply With Quote #10

    Code:
    damage_flag "a"
    in cfg/sourcemod/damagemod.cfg (delete old cfg and map change to create new.)
    __________________
    Taking paid private requests! Add me on steam/discord!
    AlliedModders Releases | Github | Private Plugins | PayPal | Steam | My Discord Server
    Cruze 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 14:33.


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