• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Broadcast Talkaction For Players "!b"

perfection

FATAL DAMAGE
Joined
Aug 27, 2011
Messages
196
Reaction score
8
Lua:
local minlevel = 400
local price = 1000000

function onSay(cid, words, param, channel)
	if(param == "") then
	doPlayerSendTextMessage(cid,4,"Invalid Param Specified")
		return TRUE
	end
	
	if getPlayerLevel(cid) < minlevel then
	doCreatureSay(cid, 'You Need Level ' .. minlevel .. ' To Broadcast.', TALKTYPE_ORANGE_1, false, cid)

	elseif getPlayerMoney(cid) < price then
	doCreatureSay(cid, 'You Dont Have ' .. price .. ' To Broadcast.', TALKTYPE_ORANGE_1, false, cid)
	else
doPlayerSendTextMessage(cid,22,"Broadcast Successfull and Cost You 10000000 gold coins")
doPlayerRemoveMoney(cid, price)
		broadcastMessage(getPlayerName(cid) .. " [" .. getPlayerLevel(cid) .. "]: " .. param, MESSAGE_STATUS_WARNING)
		
		doPlayerSendTextMessage(cid, 22, "!b \"" .. param)
	end
end

and in talkactions.xml add:

Lua:
<talkaction words="!b" event="script" value="lolol.lua"/>

rep and comment if u like it :)
 
Last edited:
I'd add

Lua:
if(param) then
to check if there was a param specified.
 
Seen this before somewhere, anyway i recommend adding an exhaust system with a true/false option.
 
I know this is an old thread but is it possible to make it with a 2 minute cooldown?
easily. add a check.

First set the check
Code:
if player:getStorageValue(broadcast.cooldown) > os.time() then
    player:sendTextmessage(MESSAGE_EVENT_ADVANCE, "You gots to wait white boy!")
   return false
end

then you need to set the cooldownk (do this after the command has run successfully)
Code:
player:setStorageValue(broadcast.cooldown, os.time() + broadcastCooldown)
 
Back
Top