Guest User

no_ammo_pickup

a guest
Jan 12th, 2020
33
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. api_version = "1.9.0.0"
  2.  
  3. AMMO_PICKUP_SIG = 0
  4. AMMO_PICKUP_CODE = {}
  5.  
  6. function read_bytes(Address, Count)
  7.     local bytes = {}
  8.     for i=0,Count-1 do
  9.         table.insert(bytes, read_byte(Address+i))
  10.     end
  11.     return bytes
  12. end
  13.  
  14. function write_bytes(Address, Bytes)
  15.     safe_write(true)
  16.     for k,v in pairs(Bytes) do
  17.         write_byte(Address+k-1, v)
  18.     end
  19.     safe_write(false)
  20. end
  21.  
  22. function OnScriptLoad()
  23.     AMMO_PICKUP_SIG = sig_scan("50515356E8????????83C41084C0750947")
  24.    
  25.     if(AMMO_PICKUP_SIG ~=0) then
  26.         AMMO_PICKUP_CODE = read_bytes(AMMO_PICKUP_SIG, 12)
  27.         write_bytes(AMMO_PICKUP_SIG, {0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90})
  28.     end
  29. end
  30.  
  31. function OnScriptUnload()
  32.     if(AMMO_PICKUP_SIG ~=0) then
  33.         write_bytes(AMMO_PICKUP_SIG, AMMO_PICKUP_CODE)
  34.     end
  35. end
RAW Paste Data