hlmod.hu
https://hlmod.hu/

No fall damage jogra
https://hlmod.hu/viewtopic.php?f=9&t=17114
Oldal: 1 / 1

Szerző:  MeSter [ 2014.08.23. 20:20 ]
Hozzászólás témája:  No fall damage jogra

Valaki meg csinálná működő képesre?
SMA Forráskód: [ Mindet kijelol ]
  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_user_flags(id) & ADMIN_LEVEL_H) {
  17. if(get_cvar_num("mp_falldamage") == 0
  18. && is_user_alive(id)
  19. && is_user_connected(id)) {
  20. if(entity_get_float(id, EV_FL_flFallVelocity) >= FALL_VELOCITY) {
  21. falling[id] = true;
  22. } else {
  23. falling[id] = false;
  24. }
  25. }
  26. }
  27. }
  28.  
  29. public client_PostThink(id) {
  30. if(get_cvar_num("mp_falldamage") == 0
  31. && is_user_alive(id)
  32. && is_user_connected(id)
  33. && get_user_flags(id) & ADMIN_LEVEL_H) {
  34. if(falling[id]) {
  35. entity_set_int(id, EV_INT_watertype, -3);
  36. }
  37. }
  38. }

Szerző:  MeSter [ 2014.08.24. 20:59 ]
Hozzászólás témája:  Re: No fall damage jogra

már probáltam ugyis jogy csak ez az egy plugin van bent akkor se mukodot

Szerző:  IrOn [ 2014.08.24. 21:30 ]
Hozzászólás témája:  Re: No fall damage jogra

SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <engine>
  3.  
  4. #define FALL_VELOCITY 350.0
  5. #define MAX_FALL_HEIGHT 250 // player would get hurt if he falled over greater height
  6.  
  7. new g_start_falling_height[33]
  8. new bool:g_height_reached[33];
  9.  
  10. public plugin_init() {
  11. register_plugin("No fall damage", "0.1", "v3x");
  12. if(!cvar_exists("mp_falldamage")) {
  13. register_cvar("mp_falldamage", "0");
  14. }
  15. }
  16.  
  17. new bool:falling[33];
  18.  
  19. public client_PreThink(id) {
  20. if(get_cvar_num("mp_falldamage") == 0 && is_user_alive(id) && get_user_flags(id) & ADMIN_KICK) {
  21. if(entity_get_float(id, EV_FL_flFallVelocity) >= FALL_VELOCITY) {
  22. if(g_height_reached[id])
  23. return
  24. new origin[3]
  25. get_user_origin(id, origin)
  26. if(!falling[id]) {
  27. //server_print("DEBUG: [%d] Start falling at height [%d]", id, origin[2])
  28. falling[id] = true
  29. g_start_falling_height[id] = origin[2]
  30. }
  31. else if(g_start_falling_height[id] - origin[2] > MAX_FALL_HEIGHT) {
  32. /*
  33.   server_print("DEBUG: [%d] MAX FALL HEIGHT is reached at height [%d]. Height difference [%d]",
  34.   id, origin[2], g_start_falling_height[id] - origin[2])
  35.   */
  36. falling[id] = false;
  37. g_height_reached[id] = true
  38. }
  39. } else {
  40. falling[id] = false;
  41. g_height_reached[id] = false
  42. }
  43. }
  44. }
  45.  
  46. public client_PostThink(id) {
  47. if(get_cvar_num("mp_falldamage") == 0 && get_user_flags(id) & ADMIN_KICK) {
  48. if(falling[id]) {
  49. entity_set_int(id, EV_INT_watertype, -3);
  50. }
  51. }
  52. }

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/