Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
No self gauss
#1
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
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)