Skip to content

Commit

Permalink
[Commands] Add /greentext command
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcernat committed Jul 31, 2017
1 parent 37095c8 commit 04a6718
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions scripts/color.lua
Expand Up @@ -152,5 +152,6 @@ color.YellowGreen = "#9ACD32"
color.Default = color.White
color.Error = color.Red
color.Warning = color.GoldenRod
color.GreenText = "#789922"

return color
4 changes: 4 additions & 0 deletions scripts/server.lua
Expand Up @@ -704,6 +704,10 @@ function OnPlayerSendMessage(pid, message)
tes3mp.SendMessage(pid, "That command is disabled on this server.\n", false)
end

elseif (cmd[1] == "greentext" or cmd[1] == "gt") and cmd[2] ~= nil then
local message = playerName .. " (" .. pid .. "): " .. color.GreenText .. ">" .. tableHelper.concatenateFromIndex(cmd, 2) .. "\n"
tes3mp.SendMessage(pid, message, true)

else
local message = "Not a valid command. Type /help for more info.\n"
tes3mp.SendMessage(pid, color.Error..message..color.Default, false)
Expand Down

0 comments on commit 04a6718

Please sign in to comment.