Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Rage Quit Plus for SAPP
- -- by H® Shaft
- -- if a player quits the game within <EXPIRE_TIME> of being killed, it announces the rage quit, example: "H® Shaft RAGE QUIT!"
- -- Optionally, for RACE and SLAYER only: if KILLER_BONUS is set to true, the killer player will have a point added to their score, and
- -- it will announce to killer: <<BONUS>> Your kill made [RAGE QUITTER NAME] RAGE QUIT! Your score + 1!"
- -- Killer Bonus: true = enabled, false = disabled, if true and game is RACE or SLAYER, the the killer who caused the player to rage quit gets +1 score 'killer bonus'
- KILLER_BONUS = true
- -- time in seconds if player leaves before this time expires it will announce they rage quit. Recommended: 15 seconds, or between 10 and 20 seconds
- -- if this value is less than 3, not a number or not a positive number, it will likely fail
- EXPIRE_TIME = 15
- -- don't edit --
- api_version = "1.10.0.0"
- rage_quitter = {}
- function OnScriptLoad()
- register_callback(cb['EVENT_GAME_START'], "OnGameStart")
- register_callback(cb['EVENT_GAME_END'], "OnGameEnd")
- register_callback(cb['EVENT_JOIN'], "OnPlayerJoin")
- register_callback(cb['EVENT_LEAVE'], "OnPlayerLeave")
- register_callback(cb['EVENT_DIE'], "OnDie")
- if get_var(0, "$gt") ~= "n/a" then
- game_started = true
- for i=1,16 do
- if player_present(i) then
- rage_quitter[get_var(i,"$hash")] = {}
- rage_quitter[get_var(i,"$hash")].raging = false
- rage_quitter[get_var(i,"$hash")].killer = nil
- end
- end
- else
- game_started = false
- end
- end
- function OnGameStart()
- rage_quitter = {}
- game_started = true
- for i=1,16 do
- if player_present(i) then
- rage_quitter[get_var(i,"$hash")] = {}
- rage_quitter[get_var(i,"$hash")].raging = false
- rage_quitter[get_var(i,"$hash")].killer = nil
- end
- end
- end
- function OnGameEnd()
- rage_quitter = {}
- game_started = false
- for i=1,16 do
- if player_present(i) then
- rage_quitter[get_var(i,"$hash")] = {}
- rage_quitter[get_var(i,"$hash")].raging = false
- rage_quitter[get_var(i,"$hash")].killer = nil
- end
- end
- end
- function OnPlayerJoin(PlayerIndex)
- if player_present(PlayerIndex) then
- rage_quitter[get_var(PlayerIndex,"$hash")] = {}
- rage_quitter[get_var(PlayerIndex,"$hash")].raging = false
- rage_quitter[get_var(PlayerIndex,"$hash")].killer = nil
- end
- end
- function OnPlayerLeave(PlayerIndex)
- local game_type = get_var(0,"$gt")
- if (game_started == true) then
- if (rage_quitter[get_var(PlayerIndex,"$hash")].raging == true) then
- for i=1,16 do
- if player_present(i) then
- if (rage_quitter[get_var(PlayerIndex,"$hash")].killer ~= nil) then
- say(i, " <<RAGE QUIT!>> " .. get_var(PlayerIndex,"$name") .. " <<RAGE QUIT!>>")
- end
- end
- end
- if (KILLER_BONUS == true) and (game_type == "race" or game_type == "slayer") then
- if (rage_quitter[get_var(PlayerIndex,"$hash")].killer ~= nil) then
- execute_command("score me +1", rage_quitter[get_var(PlayerIndex,"$hash")].killer)
- say(rage_quitter[get_var(PlayerIndex,"$hash")].killer, "<<BONUS>> Your kill made " .. get_var(PlayerIndex,"$name") .. " RAGE QUIT! Your score + 1!")
- end
- end
- end
- end
- rage_quitter[get_var(PlayerIndex,"$hash")].raging = nil
- rage_quitter[get_var(PlayerIndex,"$hash")].killer = nil
- end
- function OnDie(PlayerIndex, KillerIndex)
- PlayerIndex = tonumber(PlayerIndex)
- KillerIndex = tonumber(KillerIndex)
- if (game_started == true) then
- if (KillerIndex > 0) and (PlayerIndex ~= KillerIndex) and (get_var(PlayerIndex,"$team") ~= get_var(KillerIndex,"$team")) then
- rage_quitter[get_var(PlayerIndex,"$hash")].raging = true
- rage_quitter[get_var(PlayerIndex,"$hash")].killer = KillerIndex
- cool_down = timer((1000 * tonumber(EXPIRE_TIME)), "Cool_Down", PlayerIndex)
- end
- end
- end
- function Cool_Down(PlayerIndex)
- if (game_started == true) then
- if player_present(PlayerIndex) then
- rage_quitter[get_var(PlayerIndex,"$hash")] = {}
- rage_quitter[get_var(PlayerIndex,"$hash")].raging = false
- rage_quitter[get_var(PlayerIndex,"$hash")].killer = nil
- end
- end
- return false
- end
- function OnError(Message)
- print(debug.traceback())
- end
- -- Created by H® Shaft
- -- Visit http://halorace.org/forum/index.php
- -- The player -db-GoNe/Juhleek - a well spoken liar, cheat.
- -- -db- is: "diverging from the believable" - How ironic. A race clan where admins use rcon to favor themselves to win.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement