Advertisement
VADemon

Hajt Admin Script extension: +7 commands

Jan 21st, 2017
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.35 KB | None | 0 0
  1. -- http://unrealsoftware.de/forum_posts.php?post=408883#jn
  2. -- rewritten by VADemon
  3.  
  4. --[[ Sample
  5. commands[""] = {
  6.     arguments = 0,
  7.     syntax = "",
  8.     admin = true,
  9.     func = function (id, arguments)
  10.    
  11.     end
  12. }
  13. ]]
  14.  
  15. -- AUTO HEAL --
  16.  
  17. kevindurant_heal = {}
  18. -- while true, each player is healed
  19. kevindurant_autoheal = false    -- if true then it is automatically turned on
  20. kevindurant_regenhp = 1 -- how much HP to restore per tick
  21. kevindurant_timer = 2   -- cooldown in seconds
  22.  
  23. -- create heal entry
  24. -- is also used inside _healsecond, if a player entry doesn't exist
  25. addhook("join", "kevindurant_joinheal")
  26. function kevindurant_joinheal(id)
  27.     kevindurant_heal[id] = {}
  28.     kevindurant_heal[id].timer = kevindurant_timer
  29. end
  30.  
  31. -- remove heal entry
  32. addhook("leave", "kevindurant_leaveheal")
  33. function kevindurant_leaveheal(id)
  34.     kevindurant_heal[id] = nil
  35. end
  36.  
  37. addhook("second","kevindurant_healsecond")
  38. function kevindurant_healsecond()
  39.     if kevindurant_autoheal then
  40.        
  41.         local playertable = player(0,"tableliving")
  42.         for i = 1, #playertable do
  43.             local id = playertable[i]
  44.                
  45.                 if not kevindurant_heal[id] then
  46.                     kevindurant_joinheal(id)
  47.                 end
  48.  
  49.             if kevindurant_heal[id].timer <= 0 then
  50.                 parse("sethealth "..id.." "..player(id,"health") + kevindurant_regenhp)
  51.             else
  52.                 kevindurant_heal[id].timer = kevindurant_heal[id].timer - 1
  53.             end
  54.         end
  55.        
  56.     end
  57. end
  58.  
  59. addhook("hit","kevindurant_healreset")
  60. function kevindurant_healreset(id, s)
  61.     if kevindurant_heal[id] then
  62.         kevindurant_heal[id].timer = kevindurant_timer  -- or any other value. I don't care
  63.     end
  64. end
  65.  
  66.  
  67. -- COMMANDS --
  68.  
  69. commands["!heal"] = {
  70.     arguments = 1,
  71.     syntax = "<hp per tick>",
  72.     admin = true,
  73.     func = function (id, arguments)
  74.             local hp = tonumber(arguments[1])
  75.         if hp and hp~=0 then
  76.             msg("Auto-heal was turned ON! ".. hp .." HP/tick@C")
  77.                 kevindurant_regenhp = hp
  78.                 kevindurant_autoheal = true
  79.         elseif (not hp) or hp == 0 then
  80.             msg("Auto-heal was turned OFF!@C")
  81.                 kevindurant_autoheal = false
  82.         end
  83.     end
  84. }
  85.  
  86. commands["!ffa"] = {
  87.     arguments = 0,
  88.     syntax = "",
  89.     admin = true,
  90.     func = function (id, arguments)
  91.         msg("Setting server to !FFA mode!@C")
  92.         parse("restart")
  93.         --parse("sv_name lone | FFA/DM")
  94.         parse("sv_gamemode 1")
  95.         parse("mp_radar 0")
  96.         parse("mp_freezetime 5")
  97.         parse("mp_autoteambalance 0")
  98.         parse("sv_specmode 1")
  99.         parse("mp_idlekick 0")
  100.         parse("mp_kickpercent 0")
  101.         parse("mp_mapvoteratio 0")
  102.         parse("mp_tkpunish 0")
  103.     end
  104. }
  105. commands["!settings"] = {
  106.     arguments = 0,
  107.     syntax = "",
  108.     admin = true,
  109.     func = function (id, arguments)
  110.         msg("Setting server to !settings mode!@C")
  111.         parse("restart")
  112.         --parse("sv_name lone | Standard")
  113.         parse("sv_gamemode 0")
  114.         parse("mp_radar 1")
  115.         parse("mp_respawndelay 0")
  116.         parse("mp_freezetime 3")
  117.         parse("mp_autoteambalance 1")
  118.         parse("sv_specmode 1")
  119.         parse("mp_idlekick 0")
  120.         parse("mp_kickpercent 0")
  121.         parse("mp_mapvoteratio 0")
  122.         parse("mp_tkpunish 0")
  123.         parse("mp_startmoney 16000")
  124.     end
  125. }
  126. commands["!ctf"] = {
  127.     arguments = 0,
  128.     syntax = "",
  129.     admin = true,
  130.     func = function (id, arguments)
  131.         msg("Setting server to !ctf mode!@C")
  132.         parse("restart")
  133.         --parse("sv_name lone | CTF/Con")
  134.         parse("sv_gamemode 3")
  135.         parse("mp_freezetime 3")
  136.         parse("sv_specmode 2")
  137.         parse("mp_autoteambalance 0")
  138.         parse("mp_dispenser_money 1000")
  139.         parse("mp_building_limit Turret 9")
  140.         parse("mp_building_limit Dispenser 9")
  141.         parse("mp_building_limit Teleporter Entrance 9")
  142.         parse("mp_building_limit Teleporter Exit 9")
  143.         parse("mp_building_limit Gate Field 9")
  144.         parse("mp_building_limit Supply 9")
  145.         parse("mp_idlekick 0")
  146.         parse("mp_kickpercent 0")
  147.         parse("mp_mapvoteratio 0")
  148.         parse("mp_tkpunish 0")
  149.     end
  150. }
  151. commands["!mixctf"] = {
  152.     arguments = 0,
  153.     syntax = "",
  154.     admin = true,
  155.     func = function (id, arguments)
  156.         msg("Setting server to !mixctf mode!@C")
  157.         parse("restart")
  158.         --parse("sv_name lone | Mix/Match CTF")
  159.         parse("sv_gamemode 3")
  160.         parse("sv_password match")
  161.         parse("sv_specmode 2")
  162.         parse("mp_autoteambalance 0")
  163.         parse("mp_freezetime 7")
  164.         parse("mp_startmoney 6000")
  165.         parse("mp_dispenser_money 500")
  166.         parse("mp_building_limit Turret 3")
  167.         parse("mp_building_limit Dispenser 1")
  168.         parse("mp_building_limit Teleporter Entrance 1")
  169.         parse("mp_building_limit Teleporter Exit 1")
  170.         parse("mp_building_limit Gate Field 9")
  171.         parse("mp_idlekick 0")
  172.         parse("mp_kickpercent 0")
  173.         parse("mp_mapvoteratio 0")
  174.         parse("mp_tkpunish 0")
  175.     end
  176. }
  177. commands["!dom"] = {
  178.     arguments = 0,
  179.     syntax = "",
  180.     admin = true,
  181.     func = function (id, arguments)
  182.         msg("Setting server to !dom mode!@C")
  183.         parse("restart")
  184.         --parse("sv_name lone | Domination")
  185.         parse("sv_gamemode 2")
  186.         parse("mp_freezetime 3")
  187.         parse("sv_specmode 2")
  188.         parse("mp_autoteambalance 0")
  189.         parse("mp_idlekick 0")
  190.         parse("mp_kickpercent 0")
  191.         parse("mp_mapvoteratio 0")
  192.         parse("mp_tkpunish 0")
  193.     end
  194. }
  195. commands["!mixdom"] = {
  196.     arguments = 0,
  197.     syntax = "",
  198.     admin = true,
  199.     func = function (id, arguments)
  200.         msg("Setting server to !mixdom mode!@C")
  201.         parse("sv_restart")
  202.         --parse("sv_name lone | Mix/Match Domination")
  203.         parse("sv_password match")
  204.         parse("mp_autoteambalance 0")
  205.         parse("mp_freezetime 7")
  206.         parse("sv_specmode 2")
  207.         parse("mp_respawndelay 3")
  208.         parse("mp_idlekick 0")
  209.         parse("mp_kickpercent 0")
  210.         parse("mp_mapvoteratio 0")
  211.         parse("mp_tkpunish 0")
  212.     end
  213. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement