AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Set Damage (https://forums.alliedmods.net/showthread.php?t=317233)

PawNod 07-04-2019 05:26

Set Damage
 
How can I set the damage we receive (other than SetHamParamFloat)

thEsp 07-04-2019 05:31

Re: Set Damage
 
SetHamParamFloat it's the only good way via Ham module, there's no reason to not use it.

PawNod 07-04-2019 05:35

Re: Set Damage
 
@theEsp Can you send your public? I guess my public places wrong

OciXCrom 07-04-2019 07:21

Re: Set Damage
 
Then send yours and we'll tell you what's wrong. You're the one requesting for help.

PawNod 07-04-2019 07:51

Re: Set Damage
 
I guess victim attacker and infilictor is wrong
PHP Code:

public Hasarpn(victiminflictorattackerFloat:damagedamage_bits) {
if(
g_hasar[attacker][hs_t_el] ) {
                    
SetHamParamFloat(4get_pcvar_float(h_yumruk))
                    if(
get_pdata_int(victim75) == HIT_HEAD){
                        
SetHamParamFloat(4get_pcvar_float(h_yumruk)+15.0)
                    }
                } 

Because when I take damage I dead immediatly but when I fire I don't killer it immediatly

CrazY. 07-04-2019 08:12

Re: Set Damage
 
SetHamParamFloat is what you should use. Are you testing with bots? If yes, you also need to register the ham for bots https://forums.alliedmods.net/showthread.php?t=294861 or https://forums.alliedmods.net/showpo...5&postcount=20.

Otherwise post whole plugin code, we can't guess what these variables mean.

thEsp 07-04-2019 08:24

Re: Set Damage
 
Quote:

Originally Posted by CrazY. (Post 2657713)
Are you testing with bots? If yes, you also need to register the ham for bots https://forums.alliedmods.net/showthread.php?t=294861 or https://forums.alliedmods.net/showpo...5&postcount=20

IDK if this isn't present in < 1.9 or it didn't exist when you made that tutorial, but you can simply append "true" to Ham registers to support bots.

https://www.amxmodx.org/api/hamsandwich/RegisterHam
Code:

native HamHook:RegisterHam(Ham:function, const EntityClass[], const Callback[], Post=0, bool:specialbot = false);

CrazY. 07-04-2019 09:10

Re: Set Damage
 
Older versions of amxmodx doesn't have the specialbot parameter.

PawNod 07-04-2019 09:48

Re: Set Damage
 
@CrazY. Oh I understand I guess . Topic solved

Bugsy 07-04-2019 11:10

Re: Set Damage
 
Keep in mind that increasing the damage doesn't result in that exact loss in HP to the victim. Damage is offsetted by armor that the victim may have.

E.g. Inflicting 10.5 extra in damage will not always result in additional -10.5 hp loss.


All times are GMT -4. The time now is 17:25.

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