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

Broadcast different colors

  • Thread starter Thread starter Xikini
  • Start date Start date
X

Xikini

Guest
Current Script uses /bc colour whatever you wish to type
However only the first word will be broadcasted no other words
/bc green hello everyone! I am shiverflare!
the above will only broad cast "hello" in green
Can someone edit the script below to include all words in the sentence and not just the first word after the param?
LUA:
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
XML:
 <talkaction log="yes" words="/bc" access="4" event="script" value="broadcastclass.lua"/>
 
Last edited by a moderator:
LUA:
/bc
/bc green;
/bc white;


LUA:
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, ";")
	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
 
Back
Top