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

[REQ] Change hammer throw damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hoycieto
Senior Member
Join Date: Feb 2018
Old 01-14-2019 , 15: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 01-15-2019 , 13: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
Senior Member
Join Date: Feb 2018
Old 01-15-2019 , 17:00   Re: [REQ] Change hammer throw damage
Reply With Quote #3

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


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