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

Broadcast different colors

Xikini

I whore myself out for likes
Senator
Joined
Nov 17, 2010
Messages
6,832
Solutions
586
Reaction score
5,414
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:
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