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

dealing Extra Damage to func_breakable


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ynet
Member
Join Date: Aug 2017
Location: israel
Old 07-21-2019 , 17:00   dealing Extra Damage to func_breakable
Reply With Quote #1

so lets say that i want to make it so that players will be able to destroy vents as twice as fast than what it would usually take how do i deal damage to the entity?

PHP Code:
RegisterHam(Ham_TakeDamage"func_breakable""Breakable_damage"true);

public 
Breakable_damage(thisAttackerboolbGib)
{


    
//how to deal damage to (this) ??

    
    
return HAM_HANDLED

i tried ham_takedamage didn't work very well ;p

Last edited by Ynet; 07-21-2019 at 17:00.
Ynet is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-21-2019 , 17:17   Re: dealing Extra Damage to func_breakable
Reply With Quote #2

First of all you need to register the event as "pre", not "post". Set the last parameter in "RegisterHam" to "false". In "post" you cannot change the damage, as it's already been done. "pre" is called before dealing the damage.

Your arguments in the "Breakable_damage" function are wrong. Take a look at the API. They should be:

PHP Code:
victiminflictorattackerFloat:damagedamage_bits 
Now you need to modify the 4th argument (damage). Doubling it should make the entity die twice as fast.

PHP Code:
SetHamParamFloat(4damage 2
__________________

Last edited by OciXCrom; 07-21-2019 at 17:18.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Ynet
Member
Join Date: Aug 2017
Location: israel
Old 07-21-2019 , 17:25   Re: dealing Extra Damage to func_breakable
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
First of all you need to register the event as "pre", not "post". Set the last parameter in "RegisterHam" to "false". In "post" you cannot change the damage, as it's already been done. "pre" is called before dealing the damage.

Your arguments in the "Breakable_damage" function are wrong. Take a look at the API. They should be:

PHP Code:
victiminflictorattackerFloat:damagedamage_bits 
Now you need to modify the 4th argument (damage). Doubling it should make the entity die twice as fast.

PHP Code:
SetHamParamFloat(4damage 2


aight it worked thanks alot mate appreciete it
Ynet 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 01:43.


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