Raised This Month: $51 Target: $400
 12% 

CS:S Change AWP damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
grimmyny
Junior Member
Join Date: Dec 2016
Old 10-14-2017 , 06:41   CS:S Change AWP damage
Reply With Quote #1

Hi all. I was wondering if there is a way to change the damage given by the AWP, I would like to make it weaker. If there is a plugin or setting to do this on a CSS server please let me know. Thanks!
grimmyny is offline
poppin-fresh
AlliedModders Donor
Join Date: Aug 2010
Old 10-14-2017 , 11:23   Re: CS:S Change AWP damage
Reply With Quote #2

This is untested but should work.

PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdkhooks>

ConVar g_cvDamageModifier null;

public 
void OnPluginStart()
{
    
g_cvDamageModifier CreateConVar("sm_awp_damage""0.8""AWP damage modifier value.");
    
AutoExecConfig();
    
    
// Allows reloading
    
for (int i 1<= MaxClientsi++) {
        if (
IsClientInGame(i))
            
SDKHook(iSDKHook_OnTakeDamageOnTakeDamage);
    }
}

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

public 
void OnClientDisconnect(int client)
{
    
SDKUnhook(clientSDKHook_OnTakeDamageOnTakeDamage);
}

public 
Action OnTakeDamage(int victimint &attackerint &inflictorfloat &damageint &damagetypeint &weaponfloat damageForce[3], float damagePosition[3], int damagecustom)
{
    if (!
IsValidClient(victim) || !IsValidClient(attacker) || !IsValidEntity(weapon))
        return 
Plugin_Continue;
    
    
char buffer[32];
    
GetEntityClassname(weaponbuffersizeof(buffer));
    
    if (
StrEqual("weapon_awp"buffer)) {
        
damage *= GetConVarFloat(g_cvDamageModifier);
        return 
Plugin_Changed;
    }
    
    return 
Plugin_Continue;
}

bool IsValidClient(int client)
{
    return 
client <= MaxClients && IsClientInGame(client);

Attached Files
File Type: sp Get Plugin or Get Source (awpdamage.sp - 280 views - 1.3 KB)

Last edited by poppin-fresh; 10-14-2017 at 11:28.
poppin-fresh is offline
grimmyny
Junior Member
Join Date: Dec 2016
Old 10-21-2017 , 14:02   Re: CS:S Change AWP damage
Reply With Quote #3

THANK YOU! IT WORKS!
grimmyny 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 02:38.


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