Advertisement
HR_Shaft

Score Limit Variable for SAPP

Mar 16th, 2016
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.17 KB | None | 0 0
  1. -- Score Limit Variable for SAPP
  2. -- by H® Shaft
  3.  
  4. -- This is a sample script ONLY - Not a game play script!
  5. -- Intended for scripters who may have a need to determine what the score limit is during a game or game-type.
  6. -- not to be confused with the scorelimit "command": such as: execute_command("scorelimit 10") which is used to SET the score limit
  7. -- Score Limit Variable could be useful to announce the progress of a game and scores, such as;
  8. -- "H® Shaft needs 1 more kill to win the game!" (limit - score = remainder), or
  9. -- "Blue Team needs 1 more flag capture to win the game!"
  10.  
  11.  
  12. api_version = "1.9.0.0"
  13.  
  14. function OnScriptLoad()
  15.     register_callback(cb['EVENT_GAME_START'], "OnNewGame")
  16.     network_struct = read_dword(sig_scan("F3ABA1????????BA????????C740??????????E8????????668B0D") + 3)
  17. end
  18.  
  19. function OnNewGame()
  20.     score_limit = tonumber(read_byte(network_struct + 0x164))
  21.     for i = 1,16 do
  22.         if player_present(i) then
  23.             say(i, "The score limit is: " .. score_limit)
  24.         end
  25.     end
  26.     cprint("The score limit is: " .. score_limit)
  27. end
  28.  
  29. function OnError(Message)
  30.     print(debug.traceback())
  31. end
  32.  
  33. -- Created by H® Shaft
  34. -- Visit http://halorace.org/forum/index.php
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement