07-28-2024, 11:21 PM
This is a HLDM plugin that prevents the player from killing himself from firing gauss.
Code:
#include <amxmodx>
#include <hamsandwich>
#include <engine>
#define PLUGIN "Gauss"
#define VERSION "1.0"
#define AUTHOR "sToP !"
new e_class[64]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
}
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
if(attacker != victim || !(1 <= attacker <= 32) )
return HAM_IGNORED
entity_get_string(inflictor, EV_SZ_classname, e_class, 63)
if (attacker == inflictor || equal(e_class, "weapon_gauss"))
{
return HAM_SUPERCEDE
}
return HAM_IGNORED
}