Raised This Month: $37 Target: $400
 9% 

[REQ] Change hammer throw damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hoycieto
Member
Join Date: Feb 2018
Old Yesterday , 16:31   [REQ] Change hammer throw damage
Reply With Quote #1

Hello, I'll change damage of hammer throw into another player. Is there maybe already code like this?
hoycieto is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old Today , 14:49   Re: [REQ] Change hammer throw damage
Reply With Quote #2

PHP Code:


#include <sdkhooks>
#include <cstrike>

public void OnPluginStart()
{
    for(
int i 1<= MaxClientsi++)
    {
        if(
IsClientInGame(i)) OnClientPutInServer(i);
    }
}

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

public 
Action OnTakeDamage(int victimint &attackerint &inflictorfloat &damageint &damagetype)
{
    if( !(
attacker <= MaxClients) ) return Plugin_Continue;

    if(
attacker == inflictor || !HasEntProp(inflictorProp_Send"m_iItemDefinitionIndex")) return Plugin_Continue;


    
int m_iItemDefinitionIndex GetEntProp(inflictorProp_Send"m_iItemDefinitionIndex");
    
CSWeaponID weaponid CS_ItemDefIndexToID(m_iItemDefinitionIndex);
    
char alias[32];
    
CS_WeaponIDToAlias(weaponidaliassizeof(alias));

    if(!
StrEqual(alias"axe"false)) return Plugin_Continue;

    
//PrintToServer("axe damage %f", damage);
    
damage *= 0.5// multiplier, 1.0 normal, 0.5 half, 2.0 double

    
return Plugin_Changed;

__________________
Do not Private Message @me
Bacardi is offline
hoycieto
Member
Join Date: Feb 2018
Old Today , 18:00   Re: [REQ] Change hammer throw damage
Reply With Quote #3

I'm gonna to check this, thank you bro!
hoycieto 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 19:34.


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