"PlayerQuit" Lua Hook
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