Bugfix in permant public mode.

This commit is contained in:
A.C.M 2020-04-11 06:47:18 +02:00
parent 1e6c8adb1d
commit 4e5e014dfa
4 changed files with 29 additions and 16 deletions

View File

@ -30,7 +30,7 @@ sc["invite"] = function(player, parameter)
.. sc.green .. S("Invites you in the channel: ") .. sc.orange .. channel .. ". " .. sc.green .. S("Invites you in the channel: ") .. sc.orange .. channel .. ". "
.. sc.green .. S("Enter /c j ") .. sc.green .. channel .. S(" to join the Channel.") .. sc.green .. S("Enter /c j ") .. sc.green .. channel .. S(" to join the Channel.")
) )
sc.report(player,sc.green .. player .. " invites " .. sc.orange .. guest .. sc.green .. " to join the Channel.") sc.report(player,sc.green .. player .. S(" invites ") .. sc.orange .. guest .. sc.green .. S(" to join the Channel."))
else else
sc.print(player, sc.red .. S("Error: No Player with the name found.")) sc.print(player, sc.red .. S("Error: No Player with the name found."))

21
lib.lua
View File

@ -33,7 +33,7 @@ function lib.check(player, cmd)
else -- A command is given, but else -- A command is given, but
-- Command not found, report it. -- Command not found, report it.
if(cmd[1] ~= nil) then if(cmd[1] ~= nil) then
lib.print(player, lib.red .. mn ..": Unknown Command \"" .. lib.print(player, lib.red .. mn ..":" .. S("Unknown Command") .. " \"" ..
lib.orange .. cmd[1] .. lib.red .. "\".") lib.orange .. cmd[1] .. lib.red .. "\".")
else else
@ -41,7 +41,7 @@ function lib.check(player, cmd)
lib["help"](player, cmd) lib["help"](player, cmd)
else else
lib.print(player, lib.red .. "Unknown Command. No helpsystem available.") lib.print(player, lib.red .. S("Unknown Command. No helpsystem available."))
end --if(distancer["help"] end --if(distancer["help"]
@ -50,8 +50,8 @@ function lib.check(player, cmd)
end -- if(distancer[cmd[1 end -- if(distancer[cmd[1
else else
lib.print(player, lib.red .. "No Command for " .. mn .. " given.") lib.print(player, lib.red .. S("No Command for ") .. mn .. S(" given."))
lib.print(player, lib.red .. "Try /c help.") lib.print(player, lib.red .. S("Try /c help."))
end -- if(not cmd) end -- if(not cmd)
@ -151,6 +151,10 @@ function lib.chat(playername, text)
end -- if(lib.check_global( end -- if(lib.check_global(
if(lib.public[pname] and pname ~= playername) then -- name is in public-mode and not the player self
minetest.chat_send_player(pname, "<" .. playername .. "> " .. text)
end
elseif(lib.check_channel(pname, channel)) then elseif(lib.check_channel(pname, channel)) then
minetest.chat_send_player(pname, lib.yellow .. "<" .. lib.orange .. playername .. "@" minetest.chat_send_player(pname, lib.yellow .. "<" .. lib.orange .. playername .. "@"
.. channel .. lib.yellow .. "> " .. text) .. channel .. lib.yellow .. "> " .. text)
@ -160,15 +164,6 @@ function lib.chat(playername, text)
end -- for _,players end -- for _,players
-- Send's the message to all public Players too
for _,players in pairs(lib.public) do
if(players ~= playername) then
minetest.chat_send_player(players, "<" .. playername .. "> " .. text)
end -- if(players ~= playername
end -- for _,players
return true return true
end -- function chat end -- function chat

View File

@ -30,6 +30,7 @@ found.=gefunden.
### cmd_invite.lua ### ### cmd_invite.lua ###
invites = lädt
to join the Channel.= ein, um den Kanal zu betreten. to join the Channel.= ein, um den Kanal zu betreten.
Enter /c j =Gib /c j Enter /c j =Gib /c j
Error: No Player with the name found.=Fehler: Kein Spieler mit dem Namen gefunden. Error: No Player with the name found.=Fehler: Kein Spieler mit dem Namen gefunden.
@ -78,3 +79,11 @@ Show's the room, where <name> is.=Zeigt den Raum, wo sich <Name> aufhält.
### init.lua ### ### init.lua ###
Gives Simple_Chat a command with or without Parameter.=Gibt Simple_Chat ein Kommando mit oder ohne Parameter. Gives Simple_Chat a command with or without Parameter.=Gibt Simple_Chat ein Kommando mit oder ohne Parameter.
### lib.lua ###
given.= angegeben.
No Command for =Kein Kommando für
Try /c help.=Gib /c help ein.
Unknown Command=Unbekanntes Kommando
Unknown Command. No helpsystem available.=Unbekanntes Kommando. Hilfssystem nicht verfügbar.

View File

@ -30,6 +30,7 @@ found.=
### cmd_invite.lua ### ### cmd_invite.lua ###
invites =
to join the Channel.= to join the Channel.=
Enter /c j = Enter /c j =
Error: No Player with the name found.= Error: No Player with the name found.=
@ -78,3 +79,11 @@ Show's the room, where <name> is.=
### init.lua ### ### init.lua ###
Gives Simple_Chat a command with or without Parameter.= Gives Simple_Chat a command with or without Parameter.=
### lib.lua ###
given.=
No Command for =
Try /c help.=
Unknown Command=
Unknown Command. No helpsystem available.=