SHARE
TWEET

hit_reg_fix

it300 May 5th, 2019 (edited) 125 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Hit-reg Fix by Devieth
  2. -- Script for SAPP and Chimera
  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. clua_version = 2.05 -- Chimera
  19.  
  20. if full_build then
  21.     set_callback("map load", "OnGameStart")
  22. end
  23.  
  24. function OnScriptLoad()
  25.     register_callback(cb['EVENT_GAME_START'], "OnGameStart")
  26. end
  27.  
  28. function OnScriptUnload() end
  29.  
  30. function OnGameStart()
  31.     if full_build then
  32.         set_timer(66, "hit_reg_fix")
  33.     else
  34.         timer(66, "hit_reg_fix")
  35.     end
  36. end
  37.  
  38. function hit_reg_fix()
  39.     -- Lets loop through all the tags (doing this so this script even works on custom maps.)
  40.     for i = 0, read_word(0x4044000C) - 1 do
  41.         local tag = read_dword(0x40440000) + i * 0x20
  42.         local tag_class = string.reverse(string.sub(read_string(tag),1,4))
  43.         local tag_address = read_dword(tag + 0x14)
  44.         -- Is the tag a bipd tag?
  45.         if tag_class == "bipd" then
  46.             -- If the it is a bipd tag lets change the auto_aim_width to a smaller value.
  47.             -- Doing this makes the auto_aim (bullet curving) pull more accurately pull to the body parts.
  48.             write_float(tag_address + 0x458, value)
  49.         end
  50.     end
  51.     return false
  52. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top