Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <fakemeta>
  4.  
  5. #define MAX_PLAYERS 32
  6. #define AUTHOR "CML & aSior & Pawel"
  7.  
  8. new bool:g_hs_mode
  9. new bool:g_RestartAttempt[MAX_PLAYERS+1]
  10. new g_fwid
  11.  
  12. public plugin_init()
  13. {
  14. register_plugin("Only HS MOD", "2.0", AUTHOR)
  15. register_event("TextMsg", "eRestartAttempt", "a", "2=#Game_will_restart_in")
  16. register_concmd("amx_hs_mode", "switchCmd", ADMIN_IMMUNITY, "- <0|1> : Only HS MOD = Wylaczony|Wlaczony")
  17. register_clcmd("clcmd_fullupdate", "fullupdateCmd")
  18. register_forward(FM_TraceLine, "forward_traceline", 1);
  19. }
  20.  
  21. public fullupdateCmd()
  22. {
  23. return PLUGIN_HANDLED_MAIN
  24. }
  25.  
  26. public eRestartAttempt()
  27. {
  28. new players[MAX_PLAYERS], num
  29. get_players(players, num, "a")
  30. for (new i; i < num; ++i)
  31. g_RestartAttempt[players[i]] = true
  32. }
  33.  
  34. public switchCmd(id, level, cid)
  35. {
  36.  
  37. if(!cmd_access(id, level, cid, 2))
  38. return PLUGIN_HANDLED
  39.  
  40. new arg[2]
  41. read_argv(1, arg, 1)
  42.  
  43. new temp = str_to_num(arg)
  44.  
  45. switch(temp)
  46. {
  47. case 0:
  48. {
  49. if(!g_hs_mode)
  50. {
  51. unregister_forward(FM_TraceLine, g_fwid, 1)
  52. g_hs_mode = false
  53. }
  54. }
  55. case 1:
  56. {
  57. if(g_hs_mode)
  58. {
  59. g_fwid = register_forward(FM_TraceLine, "forward_traceline", 1)
  60. g_hs_mode = true
  61. }
  62. }
  63. }
  64. return PLUGIN_HANDLED
  65. }
  66.  
  67. public forward_traceline(Float:v1[3], Float:v2[3], noMonsters, pentToSkip)
  68. {
  69. if(!is_user_alive(pentToSkip))
  70. return FMRES_IGNORED
  71.  
  72. static entity2 ; entity2 = get_tr(TR_pHit)
  73. if(0 > entity2 > 32 || !is_user_alive(entity2))
  74. return FMRES_IGNORED
  75.  
  76. if(pentToSkip == entity2)
  77. return FMRES_IGNORED
  78.  
  79. if(get_tr(TR_iHitgroup) != 1)
  80. {
  81. set_tr(TR_flFraction,1.0)
  82. return FMRES_SUPERCEDE
  83. }
  84. return FMRES_IGNORED
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement