Po:
#include <codmod>
Dodajemy :
#include <hamsandwich>
Pod spód dajemy:
#define DMG_HEGRENADE (1<<24)
Przed lub po:
new const nazwa[] = "XXX"; new const opis[] = "Odporna na HE"; new const bronie = (1<<CSW_HEGRENADE); new const zdrowie = 0; new const kondycja = 0; new const inteligencja = 0; new const wytrzymalosc = 0;
Dajemy:
new bool:ma_klase[33]
Do "public plugin_init" dodajemy:
RegisterHam(Ham_TakeDamage, "player", "TakeDamage")
Nie możemy zapomnieć także o:
} public cod_class_enabled(id) ma_klase[id] = true; public cod_class_disabled(id) ma_klase[id] = false;
Na sam koniec dajemy public:
public TakeDamage(id, ent, attacker, Float:damage, damagebits) { if(ma_klase[id] && damagebits & DMG_HEGRENADE && ent != attacker) { SetHamParamInteger(5,DMG_GENERIC) SetHamParamEntity(2, attacker) SetHamReturnInteger(0) return HAM_SUPERCEDE } return HAM_IGNORED }
Odporność działa nawet gdy klasa ma 1/x z He.