• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Question about chat window

Breed

Intermediate OT User
Joined
Jan 7, 2015
Messages
517
Reaction score
122
Is there a way to open a new chat window with text already in that window? I'm using tfs 1.0

Example I open a custom chat window and then a greeting is displayed.
 
This seemed to work for me:
Code:
local function sendMessage(cid)
    local player = Player(cid)
    if not player then
        return false
    end
  
    player:sendChannelMessage("", "Welcome to custom channel!", TALKTYPE_CHANNEL_O, 9)
end

function onJoin(player)
    addEvent(sendMessage, 100, player:getId())
    return true
end

The '9' in the sendChannelMessage() function is the channel id.
 
This seemed to work for me:
Code:
local function sendMessage(cid)
    local player = Player(cid)
    if not player then
        return false
    end
 
    player:sendChannelMessage("", "Welcome to custom channel!", TALKTYPE_CHANNEL_O, 9)
end

function onJoin(player)
    addEvent(sendMessage, 100, player:getId())
    return true
end

The '9' in the sendChannelMessage() function is the channel id.
Thanks Alot!

I was doing it the wrong way obviously hehe
 
Back
Top