Files
cuberite-2a/MCServer/Plugins/Core/onjoinleave.lua
T

24 lines
1.1 KiB
Lua
Raw Normal View History

2013-07-31 17:10:59 +01:00
function OnPlayerJoined(Player)
2013-08-03 08:37:43 +01:00
--if( BannedPlayersIni:GetValueB("Banned", Player:GetName(), false) == true ) then
-- LOGINFO( Player:GetName() .. " tried to join, but is banned!" )
-- KickPlayer(Player:GetName(), cChatColor.Red .. "You are banned!" )
-- return true
--elseif( WhiteListIni:GetValueB("WhiteListSettings", "WhiteListOn", false ) == true ) then
-- if( WhiteListIni:GetValueB("WhiteList", Player:GetName(), false ) == false ) then
-- LOGINFO( Player:GetName() .. " tried to join, but is not whitelisted!" )
-- KickPlayer(Player:GetName(), cChatColor.Red .. "You are not whitelisted!" )
-- end
--else
ShowMOTDTo( Player )
local Server = cRoot:Get():GetServer()
Server:SendMessage(cChatColor.Yellow .. "[JOIN] " .. cChatColor.White .. Player:GetName() .. " has joined the game" )
return false
--end
2013-07-31 17:10:59 +01:00
end
function OnDisconnect(Player, Reason)
2013-08-02 07:48:47 +01:00
local Server = cRoot:Get():GetServer()
Server:SendMessage(cChatColor.Yellow .. "[LEAVE] " .. cChatColor.White .. Player:GetName() .. " has left the game" )
LOG("Player " .. Player:GetName() .. " has left the game.")
return true
2013-07-31 17:10:59 +01:00
end