AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Ham_TakeDamage question (https://forums.alliedmods.net/showthread.php?t=278566)

JusTGo 02-03-2016 12:32

Ham_TakeDamage question
 
does both codes do the same thing if not whats different between them:
#1
PHP Code:

#include <hamsandwich>
#include <amxmodx>

public plugin_init()
{
    
RegisterHam(Ham_TakeDamage"player""TakeDamage_Pre");
}

public 
TakeDamage_Pre(iVictimiInflictoriAttackerFloat:fDamageiBitDamage)
{
    
HAM_SUPERCEDE


#2
PHP Code:

#include <hamsandwich>
#include <amxmodx>

public plugin_init()
{
    
RegisterHam(Ham_TakeDamage"player""TakeDamage_Pre");
}

public 
TakeDamage_Pre(iVictimiInflictoriAttackerFloat:fDamageiBitDamage)
{
    
SetHamParamFloat(40.0);



safetymoose 02-03-2016 13:11

Re: Ham_TakeDamage question
 
Supercede blocks the damage completely, and in the second code you change the damage to 0...

georgik57 02-04-2016 08:05

Re: Ham_TakeDamage question
 
supercede will completely block the damage event(no blood will come out, victim won't be knockbacked, etc), while setting the damage to 0 will just not substract hp from the victim.


All times are GMT -4. The time now is 09:29.

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