Quote:
Originally Posted by hleV
I still don't understand what exactly do you want to make.
"Melee plugin" and "new melee system" doesn't really tell a lot.
To damage player, you can execute Ham's TakeDamage.
|
I found this in another post on this forum.
I see some includes.
The one hamsandwich is this in metamod or anything else??
Or do I need to add a file into ESF to make it work??
And if I need a file where can I get it?
And are you sure this will work in esf and ecx??
Quote:
#include <amxmodx>
#include <hamsandwich>
public plugin_init()
{
register_plugin("Grenade Damage example", "1.0", "Nomexous")
RegisterHam(Ham_TakeDamage, "player", "player_hurt")
}
public player_hurt(player, inflictor, attacker, Float:damage, damagebits)
{
// We need differentiate gun damage from grenade damage.
// We know for grenade damage, inflictor (the grenade's entity index) will not the the same as attacker (grenade's owner), so:
if (inflictor == attacker) return HAM_IGNORED
// You can alter the damage dealt. In this case, I doubled the damage dealt. This is very convenient, and not hackish at all.
// Do your own checks here. The variable "player" is the person being hit by the damage.
SetHamParamFloat(4, damage * 2.0)
return HAM_HANDLED
}
|