AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved SetHamParamFloat (https://forums.alliedmods.net/showthread.php?t=338815)

wilian159 07-27-2022 12:34

SetHamParamFloat
 
I have a question about 'SetHamParamFloat'

PHP Code:

native SetHamParamFloat(whichFloat:value); 

in the 'which' parameter what I see the most is 4
there are 1, 2, 3 and 4, what is the difference between them?

I didn't find what each number is referring to, I know that the 4 is the damage, or is it something else?

Shadows Adi 07-27-2022 13:03

Re: SetHamParamFloat
 
Code:
 /**      * Description:     Usually called whenever an entity takes any kind of damage.      *                  Inflictor is the entity that caused the damage (such as a gun).      *                  Attacker is the entity that tirggered the damage (such as the gun's owner).      * Forward params:  function(this, idinflictor, idattacker, Float:damage, damagebits);      * Return type:     Integer.      * Execute params:  ExecuteHam(Ham_TakeDamage, this, idinflictor, idattacker, Float:damage, damagebits);      */     Ham_TakeDamage,

"which" param from SetHamParamFloat, represents the argument you want to alterate.

Ham_TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)

You want to change "damage" which is fourth parameter:
Code:
SetHamParamFloat(4, some_value)

wilian159 07-27-2022 13:07

Re: SetHamParamFloat
 
Quote:

Originally Posted by Shadows Adi (Post 2785004)
Code:
 /**      * Description:     Usually called whenever an entity takes any kind of damage.      *                  Inflictor is the entity that caused the damage (such as a gun).      *                  Attacker is the entity that tirggered the damage (such as the gun's owner).      * Forward params:  function(this, idinflictor, idattacker, Float:damage, damagebits);      * Return type:     Integer.      * Execute params:  ExecuteHam(Ham_TakeDamage, this, idinflictor, idattacker, Float:damage, damagebits);      */     Ham_TakeDamage,

"which" param from SetHamParamFloat, represents the argument you want to alterate.

Ham_TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)

You want to change "damage" which is fourth parameter:
Code:
SetHamParamFloat(4, some_value)

makes perfect sense, thanks


All times are GMT -4. The time now is 00:19.

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