Skip to content

"PlayerQuit" Lua Hook

Prisima the Fox requested to merge PrisimaTF/SRB2:Playerquit_hook into next

This is my "PlayerQuit" Lua hook that is called when a player leaves.

Example:

addHook("PlayerQuit", function(player, reason)
 print(player.name)
 if (reason == KR_KICK) then
  print("was kicked.")
 end
end)

Reasons and their meanings:

KR_KICK (1) - Kicked intentionally by a server/admin

KR_PINGLIMIT (2) - Broke ping limit

KR_SYNCH (3) - Synch faliure

KR_TIMEOUT (4) - Connection timeout

KR_BAN (5) - Ban

KR_LEAVE (6) - Player quit

Edited by Monster Iestyn

Merge request reports