• 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!

An item to send message for all the players on DEFAULT CHANNEL

ADMShadow

New Member
Joined
Mar 3, 2011
Messages
23
Reaction score
0
Location
Brazil, Rio de Janeiro :B
Hi, i really tried to do that by myself, but it's pretty hard... I use TFS 0.4 and Tibia 8.60, im trying to make an item which can be used to send a message for all the players of the game on the DEFAULT CHANNEL!! I can make this item on all the channels except on the DEFAULT!

Have a look at my script :

function onSay(cid, words, param)

local itemId = 12596

if (param == "") then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Invalid parammeter")
return TRUE
end

if (doPlayerRemoveItem(cid, itemId, 1)) then
doPlayerSendChannelMessage(cid, getCreatureName(cid), param, MESSAGE_EVENT_DEFAULT, CHANNEL_DEFAULT)
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"You dont have the necessary item.")
end

return TRUE
end

It works absolutely perfect, but the message doesnt appear on the DEFAULT CHANNEL, it appears nowhere :{

But when I put on Trade Channel or another channel, it works perfectly which means only the DEFAULT CHANNEL doesn't work... can someone help me? :B
 
Last edited:
Lua:
function onSay(cid, words, param)
 
local itemId = 12596
 
if (param == "") then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Invalid parammeter")
 return TRUE
 end
 
if (doPlayerRemoveItem(cid, itemId, 1)) then
 doBroadcastMessage(getCreatureName(cid), param, MESSAGE_EVENT_ADVANCE)
 else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You dont have the necessary item.")

 end
 
return TRUE
 end

test this, i have not test it
 
OHHHHHH, U ROCKSSSSSSS

IT'S WORKING!!!! I WAS FINDING FOR SOMEONE TO HELP ME, I TRIED TO DO IT BY MYSELF, BUT I COULDN'T and u guy, could help me! Thank u so much :}

Do u know how to put the name of the player who writes the message?
 
Last edited by a moderator:
oh no, i tried, but the message just appear to the player who writes the message, the message should appear for all the players :S

When I change your line for that one :
doBroadcastMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(cid)..":"..param)

the message is broadcasted, but the message is just a number like that : 21:50 268476299
 
Lua:
for _, pid in ipairs(getPlayersOnline()) do
	doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(cid)..":"..param)
end
 
Back
Top