Advertisement
Sunstriker7

bottomless_clip_v1.lua

Oct 24th, 2020
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.89 KB | None | 0 0
  1. --bottomless_clip_v1
  2. --Created by Sunstriker7
  3. --Released under the Do Whatever the Fuck You Want With It license
  4.  
  5. --DESCRIPTION: This script sets the magazine count, grenade count, and battery of the current player's weapon every second
  6.  
  7.  
  8. api_version = "1.12.0.0"
  9.  
  10. local game_over
  11.  
  12. function OnScriptLoad()
  13.     register_callback(cb["EVENT_ALIVE"],"OnPlayerIsAlive")
  14.     register_callback(cb["EVENT_GAME_END"], "OnGameEnd")
  15.     register_callback(cb["EVENT_GAME_START"], "OnGameStart")
  16.     game_over = true
  17. end
  18.  
  19. function OnGameStart()
  20.     game_over = false
  21. end
  22.  
  23. function OnGameEnd()
  24.     game_over = true
  25. end
  26.  
  27. function OnPlayerIsAlive(...)
  28.     if (game_over ~= true) then
  29.         for i = 1,16 do
  30.             if player_present(i) and player_alive(i) then              
  31.                 execute_command("mag " .. i .. " 600")
  32.                 execute_command("nades " .. i .. "  4")
  33.                 execute_command("battery " .. i .. " 100")
  34.             end
  35.         end
  36.     end
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement