HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #include <engine>
  3.  
  4. #define FALL_VELOCITY 350.0
  5.  
  6. public plugin_init() {
  7. register_plugin("No fall damage", "0.2", "v3x");
  8. if(!cvar_exists("mp_falldamage")) {
  9. register_cvar("mp_falldamage", "0");
  10. }
  11. }
  12.  
  13. new bool:falling[33];
  14.  
  15. public client_PreThink(id) {
  16. if(get_cvar_num("mp_falldamage") == 0
  17. && is_user_alive(id)
  18. && is_user_connected(id)) {
  19. if(entity_get_float(id, EV_FL_flFallVelocity) >= FALL_VELOCITY) {
  20. falling[id] = true;
  21. } else {
  22. falling[id] = false;
  23. }
  24. }
  25. }
  26.  
  27. public client_PostThink(id) {
  28. if(get_cvar_num("mp_falldamage") == 0
  29. && is_user_alive(id)
  30. && is_user_connected(id)) {
  31. if(falling[id]) {
  32. entity_set_int(id, EV_INT_watertype, -3);
  33. }
  34. }
  35. }