Jump to content

Send message in chat


icho

Recommended Posts

i need just to send random message in chat but my code isn't working, there are no errors or warnings in log

 

local messages = {'message1', 'message2'}

local function sendMsgInChat()
    local randIndex = math.random(1, #messages)
    local randMsg = messages[randIndex]

    sendServerCommand('chat', '[SERVER]: '..randMsg)
end

Events.EveryHours.Add(sendMsgInChat)
Link to comment
Share on other sites

On 8/30/2023 at 5:20 AM, icho said:

i solved this problem, but i have another, if i use cyrillic messages are broken, i tried utf8, utf8-bom, utf16le, utf16be and windows1251

Try to use media/lua/shared/Translate/RU/IG_UI_RU.txt file to encode cyrillic localization. Create 31 line with cyrillic symbols and then use them for lua.
F.e, IGUI_F = "Ф",

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...