Advertisement
it300

hit_reg_fix

May 5th, 2019
481
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.42 KB | None | 0 0
  1. -- Hit-reg Fix by Devieth
  2. -- Script for SAPP
  3.  
  4. -- Default = 0.08
  5. -- Recommended = 0.05
  6. -- Minimum = 0.045
  7.  
  8. -- Above 0.08 hit-reg gets worse, unless you want that...
  9. -- Below 0.03 headshots STOP WORKING ENTIRELY!!!
  10.  
  11. value = 0.05
  12.  
  13. -- Force enable the fix every time the script is loaded/reloaded.
  14. -- **Warning** If the script loads and no map is loaded the server WILL crash.
  15. force_enable = false
  16.  
  17. api_version = "1.10.0.0" -- SAPP
  18.  
  19. function OnScriptLoad()
  20.     register_callback(cb['EVENT_GAME_START'], "OnGameStart")
  21. end
  22.  
  23. function OnScriptUnload() end
  24.  
  25. function OnGameStart()
  26.     timer(66, "hit_reg_fix")
  27. end
  28.  
  29. function hit_reg_fix()
  30.     -- Lets loop through all the tags (doing this so this script even works on custom maps.)
  31.     for i = 0, read_word(0x4044000C) - 1 do
  32.         local tag = read_dword(0x40440000) + i * 0x20
  33.         local tag_class = string.reverse(string.sub(read_string(tag),1,4))
  34.         local tag_address = read_dword(tag + 0x14)
  35.         -- Is the tag a bipd tag?
  36.         if tag_class == "bipd" then
  37.             -- If the it is a bipd tag lets change the auto_aim_width to a smaller value.
  38.             -- Doing this makes the auto_aim (bullet curving) pull more accurately pull to the body parts.
  39.             write_float(tag_address + 0x458, value)
  40.         end
  41.     end
  42.     return false
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement