Advertisement
HR_Shaft

Rage Quit v1 for Phasor v2

Apr 7th, 2014
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.83 KB | None | 0 0
  1. --[[ ###         Rage Quit v1      ###]]--
  2. --[[ ### by H® Shaft for Phasor v2 ###]]--
  3.  
  4. -- if a player quits the game within <expire_time> of being killed, it announces: "<PlayerName> RAGE QUIT!"
  5.  
  6. -- edit --
  7. expire_time = 10  --| time (in seconds) if player leaves before this time expires it will announce they rage quit
  8.  
  9. -- don't edit --
  10. rage_quitter = {}
  11. game_started = false
  12.  
  13. function GetRequiredVersion()
  14.     return 200
  15. end
  16.  
  17. function OnScriptLoad(process, game, persistent)
  18.     for i=0,15 do
  19.         if getplayer(i) then
  20.             rage_quitter[i] = false
  21.         end
  22.     end
  23.     game_started = false
  24. end
  25.  
  26. function OnNewGame(map)
  27.     for i=0,15 do
  28.         if getplayer(i) then
  29.             rage_quitter[i] = false
  30.         end
  31.     end
  32.     game_started = true
  33. end
  34.  
  35. function OnPlayerJoin(player)
  36.     if getplayer(player) then
  37.         rage_quitter[player] = false
  38.     end
  39. end
  40.  
  41. function OnPlayerLeave(player)
  42.     if getplayer(player) then
  43.         if game_started then
  44.             if rage_quitter[player] then
  45.                 for i=0,15 do
  46.                     if getplayer(i) then
  47.                         privatesay(i, getname(player) .. " RAGE QUIT!")
  48.                     end
  49.                 end
  50.             end
  51.         end
  52.         rage_quitter[player] = {}
  53.     end    
  54. end
  55.  
  56. function OnPlayerKill(killer, victim, mode)
  57.     if getplayer(victim) then
  58.         if mode == 4 and game_started then
  59.             rage_quitter[victim] = true
  60.             raging = registertimer(1000 * expire_time, "Rage_Quit", victim)
  61.         end    
  62.     end    
  63. end
  64.  
  65. function Rage_Quit(id, count, player)
  66.     if getplayer(player) then
  67.         rage_quitter[player] = false
  68.     end
  69.     return false           
  70. end
  71.  
  72. function OnGameEnd(stage)
  73.     if stage == 1 then
  74.         game_started = false
  75.         if raging then
  76.             removetimer(raging)
  77.             raging = nil
  78.         end        
  79.     end
  80. end
  81.  
  82. -- Created by H® Shaft thank you to Oxide, AelitePrime, Nugget & Wizard.
  83. -- Visit http://halorace.org/forum/index.php?topic=514.0 or
  84. -- Visit http://pastebin.com/u/HR_Shaft for more phasor scripts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement