Advertisement
HR_Shaft

Zero Respawn Time for SAPP

Oct 2nd, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.19 KB | None | 0 0
  1. -- Zero Respawn Time
  2. -- by H® Shaft
  3.  
  4. -- Sets players to zero respawn time
  5.  
  6. -- don't edit --
  7. api_version = "1.8.0.0"
  8. game_started = false
  9.  
  10. function OnScriptLoad()
  11.     register_callback(cb['EVENT_GAME_START'], "OnNewGame")
  12.     register_callback(cb['EVENT_GAME_END'], "OnGameEnd")
  13.     register_callback(cb['EVENT_DIE'], "OnPlayerDeath")
  14.     register_callback(cb['EVENT_JOIN'], "OnPlayerJoin")
  15.     if get_var(0, "$gt") ~= "n/a" then
  16.         game_started = true
  17.         for i = 1, 16 do
  18.             if player_present(i) then
  19.                 write_dword(get_player(i) + 0x2C, 0)
  20.             end
  21.         end    
  22.     else
  23.         game_started = false
  24.     end
  25. end
  26.  
  27. function OnPlayerJoin(PlayerIndex)
  28.     if game_started and player_present(PlayerIndex) then
  29.         write_byte(get_player(PlayerIndex) + 0x20, 0)
  30.     end
  31. end
  32.  
  33. function OnPlayerDeath(PlayerIndex, KillerIndex)
  34.     if game_started and player_present(PlayerIndex) then
  35.         write_dword(get_player(PlayerIndex) + 0x2C, 0)
  36.     end
  37. end
  38.  
  39. function OnNewGame()   
  40.     game_started = true
  41.     for i = 1, 16 do
  42.         if player_present(i) then
  43.             write_dword(get_player(i) + 0x2C, 0)
  44.         end
  45.     end
  46. end
  47.  
  48. function OnGameEnd()   
  49.     game_started = false
  50. end
  51.  
  52. -- Created by H® Shaft
  53. -- Visit Visit http://halorace.org/forum/index.php
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement