HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <engine>
  4.  
  5. public SetHostageHp(id)
  6. {
  7. new health=get_cvar_num("mp_hostagehp")
  8. if (health==100) return PLUGIN_HANDLED
  9. if (health>9999) set_cvar_num("mp_hostagehp",100)
  10. if (health<=0) set_cvar_num("mp_hostagehp",100)
  11.  
  12. new iHos = find_ent_by_class(-1, "hostage_entity")
  13. while(iHos != 0)
  14. {
  15. entity_set_float(iHos, EV_FL_health, get_cvar_float("mp_hostagehp"))
  16. // client_print(id, 3,"[DEBUG] túsz ID% d immár% .0f HP", iHos, Entvars_Get_Float(iHos, EV_FL_health))
  17. iHos = find_ent_by_class(iHos, "hostage_entity")
  18. }
  19. new jHos = find_ent_by_class(-1, " monster_scientist")
  20. while(jHos != 0)
  21. {
  22. entity_set_float(jHos, EV_FL_health, get_cvar_float("mp_hostagehp"))
  23. // client_print(id, 3,"[DEBUG] túsz id % d immár% .0f HP", iHos, Entvars_Get_Float(iHos, EV_FL_health))
  24. iHos = find_ent_by_class(jHos, " monster_scientist")
  25. }
  26. return PLUGIN_CONTINUE
  27. }
  28.  
  29. public plugin_init()
  30. {
  31. register_plugin("Hostage HP", "1.1", "AssKicR")
  32. register_cvar("mp_hostagehp","100") //Max is 9999
  33. register_event("RoundTime", "SetHostageHp", "bc")
  34. }