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

Braodcast Players

jesse11

New Member
Joined
Apr 30, 2010
Messages
29
Reaction score
0
I need a script that lets players broadcast in white letters with an exhaust of every 2 minutes
!broadcast "write here" like this
 
Lua:
local timing = 120  -- in sconds
local storage = 19920	-- empty storage
function onSay(cid, words, param, channel)
	if(param == '') then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") and true end
	if exhaustion.get(cid, storage) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You need to wait more "..exhaustion.get(cid, storage) .." seconds." ) end
	if getPlayerGroupId(cid) >= 3 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED,"Keepin mind Gm's, Gods don't have exhaustion on this talkaction.") end
	exhaustion.set(cid, storage, timing)
	doBroadcastMessage(getCreatureName(cid).."["..getPlayerLevel(cid).."] : "..param, MESSAGE_TYPES["advance"])
	return true
end
 
ye this means you dont know how to put the command on your server, go to the talkaction.xml
paste this
XML:
<talkaction words="!broadcast" event="script" value="playerbc.lua"/>
Then open the tlkaction-->scripts--> new playerbc.lua
Lua:
local timing = 120 -- in sconds
local storage = 19920 -- empty storage
function onSay(cid, words, param, channel)
	if(param == '') then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") and true end
	if exhaustion.get(cid, storage) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You need to wait more "..exhaustion.get(cid, storage) .." seconds." ) end
	if getPlayerGroupId(cid) >= 3 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED,"Keepin mind Gm's, Gods don't have exhaustion on this talkaction.") end
	exhaustion.set(cid, storage, timing)
	doBroadcastMessage(getCreatureName(cid).."["..getPlayerLevel(cid).."] : "..param, MESSAGE_TYPES["advance"])
	return true
end
 
Lua:
local timing = 120 -- in seconds
local storage = 19920 -- empty storage

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

	if(exhaustion.get(cid, storage)) then
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need to wait more "..exhaustion.get(cid, storage) .." seconds.")
	end

	if(getPlayerGroupId(cid) >= 3) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Keep in mind Gm's, Gods don't have exhaustion on this talkaction."))
	end

	exhaustion.set(cid, storage, timing)
	doBroadcastMessage(getCreatureName(cid).."["..getPlayerLevel(cid).."] : "..param, MESSAGE_TYPES["advance"])
	return true
end

There's no need to return "and true" in line 6.
 
Last edited:
Back
Top