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

How Do I Change the color when i broadcast?

sorry dude im running ots 3 years thats imposibile lol:$

Huh? :confused: Its not impossible.

I dont think it can be done in lua, but in sources it should be possible.

Look up for "broadcast" all up in sources (maybe game.cpp or luascript.cpp) and if you find it then look up for something like "messagetype" or something like that.

I know basically nothing of hardcoding but there's also no reason for something like this to be "impossible".
 
It's changeble through sources, I don't have lastest devcpp and I'm to lazy to find it, but it's set as warning message class.. just find it and change
 
Or just write a custom broadcast command which broadcasts a certain message type, that will make you able to set the broadcast to be anything you want, green display, white display, bottom screen, orange in chat, red in chat, blue in chat, or whatever else there is.

Code:
doBroadcastMessage(message, type)

Type =
Code:
MESSAGE_EVENT_ORANGE
MESSAGE_STATUS_CONSOLE_ORANGE
MESSAGE_STATUS_WARNING
MESSAGE_EVENT_ADVANCE
MESSAGE_EVENT_DEFAULT
MESSAGE_STATUS_DEFAULT
MESSAGE_INFO_DESCR
MESSAGE_STATUS_SMALL
MESSAGE_STATUS_CONSOLE_BLUE
 
Doesn't tfs has that.. ? Broadcast class...

Yep, you're right;

Code:
<talkaction log="yes" words="/bc" access="4" event="script" value="broadcastclass.lua"/>

Code:
function onSay(cid, words, param, channel)
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
		return true
	end

	local t = string.explode(param, " ", 1)
	if(not t[2]) then
		doBroadcastMessage(t[1])
	elseif(not doBroadcastMessage(t[2], MESSAGE_TYPES[t[1]])) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Bad message color type.")
	end

	return true
end

Code:
MESSAGE_TYPES = {
	["advance"] = MESSAGE_EVENT_ADVANCE,
	["event"] = MESSAGE_EVENT_DEFAULT,
	["white"] = MESSAGE_EVENT_DEFAULT,
	["orange"] = MESSAGE_STATUS_CONSOLE_ORANGE,
	["info"] = MESSAGE_INFO_DESCR,
	["green"] = MESSAGE_INFO_DESCR,
	["small"] = MESSAGE_STATUS_SMALL,
	["blue"] = MESSAGE_STATUS_CONSOLE_BLUE,
	["red"] = MESSAGE_STATUS_CONSOLE_RED,
	["warning"] = MESSAGE_STATUS_WARNING,
	["status"] = MESSAGE_STATUS_DEFAULT
}

So there you go.
 
Back
Top