Advertisement
Combreal

ammo.lua

Feb 7th, 2014
614
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.74 KB | None | 0 0
  1. -- For Unlimited ammo --
  2.  
  3. function GetRequiredVersion()
  4.     return 200
  5. end
  6.  
  7.  
  8. function OnScriptLoad(processid, game, persistent) end
  9.  
  10. function OnPlayerSpawnEnd(player, m_objectId)
  11.  
  12.     registertimer(1000, "InfiniteAmmo", player)
  13.  
  14. end
  15.  
  16.  
  17. function InfiniteAmmo(id, count, player)
  18.  
  19.     local m_player = getplayer(player)
  20.     if m_player then
  21.         local objId = readdword(m_player, 0x34)
  22.         local m_object = getobject(objId)
  23.         if m_object then
  24.             for i = 0,3 do
  25.                 local weapId = readdword(m_object, 0x2F8 + (i * 4))
  26.                 local m_weapon = getobject(weapId)
  27.                 if m_weapon then
  28.                     writeword(m_weapon, 0x2B6, 9999)
  29.                     writeword(m_weapon, 0x2B8, 9999)
  30.                     updateammo(weapId)
  31.                 end
  32.             end
  33.  
  34.             return true
  35.         end
  36.     end
  37.  
  38.     return false
  39. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement