This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

How do I change the head dmg


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kostov
Member
Join Date: Jan 2010
Location: Bulgaria, Sofia
Old 05-10-2010 , 14:06   How do I change the head dmg
Reply With Quote #1

How can this transformed code, so the impact to the head to take more dmg?

PHP Code:
#include <amxmodx>
#include <hamsandwich>

new CvarFloat

public plugin_init()
{
    
register_plugin("""""")
    
CvarFloat      register_cvar("awp_damage""50");
    
RegisterHam(Ham_TakeDamage,"player","TakeDamage");
}

public 
TakeDamage(victim,inflictor,attacker,Float:damage,damage_bits){
    if(
inflictor && inflictor)
        
SetHamParamFloat(4get_user_weapon(attacker) == CSW_KNIFE get_pcvar_float(CvarFloat) : damage)

kostov is offline
HLM
Senior Member
Join Date: Apr 2008
Location: C:\WINDOWS\System32
Old 05-10-2010 , 14:22   Re: How do I change the head dmg
Reply With Quote #2

are you wanting the head damage to deal 50 more damage?
__________________
+|- KARMA Respectively

HLM is offline
kostov
Member
Join Date: Jan 2010
Location: Bulgaria, Sofia
Old 05-10-2010 , 14:25   Re: How do I change the head dmg
Reply With Quote #3

shoot body = 50dmg
shoot head =
over 50dmg
kostov is offline
HLM
Senior Member
Join Date: Apr 2008
Location: C:\WINDOWS\System32
Old 05-10-2010 , 14:39   Re: How do I change the head dmg
Reply With Quote #4

Quote:
Originally Posted by kostov View Post
Code:
        SetHamParamFloat(4, get_user_weapon(attacker) == CSW_KNIFE ? get_pcvar_float(CvarFloat) : damage)
I dont know too much about sethamparamfloat, but im reading this as, if its a headshot with csw_knife, hit him for 50 damage, else, just do the normal damage, so...

Code:
SetHamParamFloat(4, get_user_weapon(attacker) == CSW_KNIFE ? (damage + get_pcvar_float(CvarFloat)) : damage
that should fix it, but I dont know to be honest
__________________
+|- KARMA Respectively

HLM is offline
kostov
Member
Join Date: Jan 2010
Location: Bulgaria, Sofia
Old 05-10-2010 , 14:53   Re: How do I change the head dmg
Reply With Quote #5

Currently, wherever it takes targeting 50 damage. I just want to change the headshot to take in more than a certain cvar
kostov is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-10-2010 , 15:20   Re: How do I change the head dmg
Reply With Quote #6

You can't get whether it's a headshot or not based on the Ham_TakeDamage forward alone (unless you want to compare the guns with the damage dealt, which would be dumb and ugly). You'll need to use different forwards.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 05-11-2010 , 12:46   Re: How do I change the head dmg
Reply With Quote #7

use Ham_TraceAttack in pre(without 1 in the end of the hook in plugin init)
instead Ham_TakeDamage

and then get the hitplace from traceline:
Code:
hitplace = get_tr2( tr, TR_iHitgroup )
(you have tr in the hook)

I just recenly have an issue that I was needing hitplace in hamsandwich. As far as I remember its the only way.
__________________
Voi 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 19:22.


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