diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-06-29 17:30:05 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-06-29 17:30:05 +0200 |
commit | 7b75aaea7c538f61518a60fe4af363383020e0bc (patch) | |
tree | a4ee92f7763ca9931e6c1e5b96a2b5275206ab46 /MCServer/Plugins/Core/ban.lua | |
parent | Added a function that allows you to change the /back coordinates. (diff) | |
download | cuberite-7b75aaea7c538f61518a60fe4af363383020e0bc.tar cuberite-7b75aaea7c538f61518a60fe4af363383020e0bc.tar.gz cuberite-7b75aaea7c538f61518a60fe4af363383020e0bc.tar.bz2 cuberite-7b75aaea7c538f61518a60fe4af363383020e0bc.tar.lz cuberite-7b75aaea7c538f61518a60fe4af363383020e0bc.tar.xz cuberite-7b75aaea7c538f61518a60fe4af363383020e0bc.tar.zst cuberite-7b75aaea7c538f61518a60fe4af363383020e0bc.zip |
Diffstat (limited to 'MCServer/Plugins/Core/ban.lua')
-rw-r--r-- | MCServer/Plugins/Core/ban.lua | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/MCServer/Plugins/Core/ban.lua b/MCServer/Plugins/Core/ban.lua index a4a4822bd..4e882b66f 100644 --- a/MCServer/Plugins/Core/ban.lua +++ b/MCServer/Plugins/Core/ban.lua @@ -18,23 +18,27 @@ function HandleBanCommand( Split, Player ) return true
end
-function BanPlayer( PlayerName, Reason )
- if( Reason == nil ) then
+
+
+
+
+function BanPlayer(PlayerName, Reason)
+ -- Ban the player in the banned.ini:
+ BannedPlayersIni:SetValueB("Banned", PlayerName, true)
+ BannedPlayersIni:WriteFile()
+
+ -- Kick the player:
+ if (Reason == nil) then
Reason = "You have been banned"
end
-
- local Success, RealName = KickPlayer( PlayerName, Reason )
- if( Success == false ) then
- return false
+ local Success = KickPlayer(PlayerName, Reason)
+ if (not(Success)) then
+ return false;
end
- LOGINFO( "'" .. RealName .. "' is being banned for ( "..Reason..") " )
-
- local Server = cRoot:Get():GetServer()
- Server:SendMessage( "Banning " .. RealName )
-
- BannedPlayersIni:SetValueB("Banned", RealName, true)
- BannedPlayersIni:WriteFile()
+ LOGINFO("'" .. PlayerName .. "' has been banned (\"" .. Reason .. "\") ");
+ local Server = cRoot:Get():GetServer();
+ Server:SendMessage("Banned " .. PlayerName);
return true
end
\ No newline at end of file |