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

Normal Player Broadcast

Himii

Premium User
Premium User
Joined
Jan 19, 2011
Messages
1,268
Solutions
5
Reaction score
187
Location
Sweden
Hello guys

Anyone got a script that normal players can use to broadcast but it cost like 10gp per letter and it will broadcast blue color (So that it will only show upp in Default)

Repp+, if you helped me!
 
LUA:
function onSay(cid, words, param, channel)
	if not param or param = '' then
		return doPlayerSendCancel(cid, "Command requires param.")
	end
	
	local lenght = string.len(param)
	local totalMoney = lenght * 10
	if doPlayerRemoveMoney(cid, totalMoney) then
		return doBroadcastMessage(param, MESSAGE_TYPES["blue"])
	else
		return doPlayerSendCancel(cid, "You do not have enough money. It costs 10 gold coins per each letter.")
	end
	return true
end
 
LUA:
function onSay(cid, words, param, channel)
	if not param or param = '' then
		return doPlayerSendCancel(cid, "Command requires param.")
	end
	
	local lenght = string.len(param)
	local totalMoney = lenght * 10
	if doPlayerRemoveMoney(cid, totalMoney) then
		return doBroadcastMessage(param, MESSAGE_TYPES["blue"])
	else
		return doPlayerSendCancel(cid, "You do not have enough money. It costs 10 gold coins per each letter.")
	end
	return true
end


Error
18:01:07] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/broadcastp.lua:2: 'then' expected near '='
[07/12/2012 18:01:07] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/broadcastp.lua)
[07/12/2012 18:01:07] data/talkactions/scripts/broadcastp.lua:2: 'then' expected near '='
 
Code:
function onSay(cid, words, param, channel)
	if not param or param == '' then
		return doPlayerSendCancel(cid, "Command requires param.")
	end
 
	local lenght = string.len(param)
	local totalMoney = lenght * 10
	if doPlayerRemoveMoney(cid, totalMoney) then
		return doBroadcastMessage(param, MESSAGE_TYPES["blue"])
	else
		return doPlayerSendCancel(cid, "You do not have enough money. It costs 10 gold coins per each letter.")
	end
	return true
end

(fixed the error in Darkhaos' code)
 
Code:
function onSay(cid, words, param, channel)
	if not param or param == '' then
		return doPlayerSendCancel(cid, "Command requires param.")
	end
 
	local lenght = string.len(param)
	local totalMoney = lenght * 10
	if doPlayerRemoveMoney(cid, totalMoney) then
		return doBroadcastMessage(param, MESSAGE_TYPES["blue"])
	else
		return doPlayerSendCancel(cid, "You do not have enough money. It costs 10 gold coins per each letter.")
	end
	return true
end

(fixed the error in Darkhaos' code)

It is possible to make the name come up like:
19:39 Test: Hello
 
LUA:
function onSay(cid, words, param, channel)
	if not param or param == '' then
		return doPlayerSendCancel(cid, "Command requires param.")
	end
 
	local lenght = string.len(param)
	local totalMoney = lenght * 10
	if doPlayerRemoveMoney(cid, totalMoney) then
		return doBroadcastMessage(getCreatureName(cid).. ": " .. param, MESSAGE_TYPES["blue"])
	else
		return doPlayerSendCancel(cid, "You do not have enough money. It costs 10 gold coins per each letter.")
	end
	return true
end
 
Back
Top