Made MagicCarpet more magical!
This commit is contained in:
parent
55e6963107
commit
914a318b8e
28
MCServer/Plugins/MagicCarpet/coremessaging.lua
Normal file
28
MCServer/Plugins/MagicCarpet/coremessaging.lua
Normal file
@ -0,0 +1,28 @@
|
||||
IniFile = cIniFile( "settings.ini" )
|
||||
IniFile:ReadFile()
|
||||
UsePrefixes = IniFile:GetValueSet( "Messaging", "Prefixes", "true" )
|
||||
IniFile:WriteFile()
|
||||
|
||||
function SendMessage(a_Player, a_Message)
|
||||
if (UsePrefixes) then
|
||||
a_Player:SendMessage(cChatColor.Yellow .. "[INFO] " .. cChatColor.White .. a_Message)
|
||||
else
|
||||
a_Player:SendMessage(cChatColor.Yellow .. a_Message)
|
||||
end
|
||||
end
|
||||
|
||||
function SendMessageSuccess(a_Player, a_Message)
|
||||
if (UsePrefixes) then
|
||||
a_Player:SendMessage(cChatColor.Green .. "[INFO] " .. cChatColor.White .. a_Message)
|
||||
else
|
||||
a_Player:SendMessage(cChatColor.Green .. a_Message)
|
||||
end
|
||||
end
|
||||
|
||||
function SendMessageFailure(a_Player, a_Message)
|
||||
if (UsePrefixes) then
|
||||
a_Player:SendMessage(cChatColor.Red .. "[INFO] " .. cChatColor.White .. a_Message)
|
||||
else
|
||||
a_Player:SendMessage(cChatColor.Red .. a_Message)
|
||||
end
|
||||
end
|
@ -33,17 +33,15 @@ end
|
||||
|
||||
function HandleCarpetCommand( Split, Player )
|
||||
Carpet = Carpets[ Player ]
|
||||
PluginManager = cPluginManager:Get()
|
||||
local Core = PluginManager:GetPlugin("Core")
|
||||
|
||||
|
||||
if( Carpet == nil ) then
|
||||
Carpets[ Player ] = cCarpet:new()
|
||||
Core:Call("SendMessageSuccess", Player, "You're on a magic carpet!")
|
||||
Core:Call("SendMessage", Player, "Look straight down to descend. Jump to ascend.")
|
||||
SendMessageSuccess(Player, "You're on a magic carpet!")
|
||||
SendMessage(Player, "Look straight down to descend. Jump to ascend.")
|
||||
else
|
||||
Carpet:remove()
|
||||
Carpets[ Player ] = nil
|
||||
Core:Call("SendMessageSuccess", Player, "The carpet vanished!")
|
||||
SendMessageSuccess(Player, "The carpet vanished!")
|
||||
end
|
||||
|
||||
return true
|
||||
|
@ -321,7 +321,7 @@ void cServer::OnConnectionAccepted(cSocket & a_Socket)
|
||||
return;
|
||||
}
|
||||
|
||||
LOG("Client \"%s\" connected!", ClientIP.c_str());
|
||||
LOGD("Client \"%s\" connected!", ClientIP.c_str());
|
||||
|
||||
cClientHandle * NewHandle = new cClientHandle(&a_Socket, m_ClientViewDistance);
|
||||
if (!m_SocketThreads.AddClient(a_Socket, NewHandle))
|
||||
|
Loading…
Reference in New Issue
Block a user