Skip to content

Commit

Permalink
feat: talkaction for test sendTextMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas committed Jan 18, 2024
1 parent d7ea2af commit a9c6069
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions data/scripts/talkactions/god/test_send_message.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
local sendMessage = TalkAction("/testmessage")

function sendMessage.onSay(player, words, param)
-- create log
logCommand(player, words, param)

if param == "" or param == nil then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Message type is missing, please enter a message type.")
return
end

local split = param:split(",")
local messageType = tonumber(split[1])
local textCollor = TEXTCOLOR_WHITE_EXP
if split[2] then
textCollor = tonumber(split[2])
end

player:sendTextMessage(messageType, "Testing message type.", player:getPosition(), 500, textCollor)
return true
end

sendMessage:separator(" ")
sendMessage:groupType("god")
sendMessage:register()

0 comments on commit a9c6069

Please sign in to comment.