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

Zarabustor

Human Being
Joined
Sep 10, 2009
Messages
186
Reaction score
0
Location
Cancun, Mexico
I want an script is a broadcast item that when you use get +15 broadcasts added you can say !broadcastinfo to know when is your next broadcast available and also to know how much broadcasts is available to you, also say !broadcast message here - to broadcast, it got an exhaust of about 5 minutes to do a broadcast!

Thanks.
PLEASE HELP ME -.^

ILL REP++
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	return getPlayerStorageValue(cid, 5000) == -1 and setPlayerStorageValue(cid, 5000, 15) and doPlayerSendTextMessage(cid, 20, "You have " .. getPlayerStorageValue(cid, 5000) .. " broadcasts left.") or doPlayerSendCancel(cid, "You may not use this unless you finish your broadcasts.")
end
Code:
function onSay(cid, words, param, channel)
	return getPlayerStorageValue(cid, 5000) >= 15 and doBroadcastMessage("" .. getCreatureName(cid) .. " [" .. getPlayerLevel(cid) .. "]: " .. param .. "") and setPlayerStorageValue(cid, 5000, getPlayerStorageValue(cid, 5000)-1) and doPlayerSendTextMessage(cid, 20, "You have " .. getPlayerStorageValue(cid, 5000) .. " broadcasts left.") or doPlayerSendCancel(cid, "You dont have any broadcasts left.")
end
Code:
function onSay(cid, words, param, channel)
	return doPlayerSendTextMessage(cid, 20, "You have " .. getPlayerStorageValue(cid, 5000) .. " broadcasts left.")
end
 
Last edited:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	return getPlayerStorageValue(cid, 5000) == -1 and setPlayerStorageValue(cid, 5000, 15) and doPlayerSendTextMessage(cid, 20, "You have " .. getPlayerStorageValue(cid, 5000) .. " broadcasts left.") or doPlayerSendCancel(cid, "You may not use this unless you finish your broadcasts.")
end
Code:
function onSay(cid, words, param, channel)
	return getPlayerStorageValue(cid, 5000) >= 15 and doBroadcastMessage("" .. getCreatureName(cid) .. " [" .. getPlayerLevel(cid) .. "]: " .. param .. ") and setPlayerStorageValue(cid, 5000, getPlayerStorageValue(cid, 5000)-1) and doPlayerSendTextMessage(cid, 20, "You have " .. getPlayerStorageValue(cid, 5000) .. " broadcasts left.") or doPlayerSendCancel(cid, "You dont have any broadcasts left.")
end
Code:
function onSay(cid, words, param, channel)
	return doPlayerSendTextMessage(cid, 20, "You have " .. getPlayerStorageValue(cid, 5000) .. " broadcasts left.")
end


nice neat style =}
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	return getPlayerStorageValue(cid, 5000) == -1 and setPlayerStorageValue(cid, 5000, 15) and doPlayerSendTextMessage(cid, 20, "You have " .. getPlayerStorageValue(cid, 5000) .. " broadcasts left.") or doPlayerSendCancel(cid, "You may not use this unless you finish your broadcasts.")
end
Code:
function onSay(cid, words, param, channel)
	return getPlayerStorageValue(cid, 5000) >= 15 and doBroadcastMessage("" .. getCreatureName(cid) .. " [" .. getPlayerLevel(cid) .. "]: " .. param .. "") and setPlayerStorageValue(cid, 5000, getPlayerStorageValue(cid, 5000)-1) and doPlayerSendTextMessage(cid, 20, "You have " .. getPlayerStorageValue(cid, 5000) .. " broadcasts left.") or doPlayerSendCancel(cid, "You dont have any broadcasts left.")
end
Code:
function onSay(cid, words, param, channel)
	return doPlayerSendTextMessage(cid, 20, "You have " .. getPlayerStorageValue(cid, 5000) .. " broadcasts left.")
end

It works but i want something more explainable, if you got broadcast and saying !broadcastinfo say You have 15 broadcast left, the next broadcast will be in 5 minutes.

Also when i use one of my 15 broadcast i waited 5 minutes and says You dont have any broadcasts left :/
 
Code:
function onSay(cid, words, param, channel)
	return getPlayerStorageValue(cid, 5000) <= 15 and os.time() >= getPlayerStorageValue(cid, 5001) + 300 and doBroadcastMessage("" .. getCreatureName(cid) .. " [" .. getPlayerLevel(cid) .. "]: " .. param .. "") and setPlayerStorageValue(cid, 5001, os.time()) and setPlayerStorageValue(cid, 5000, getPlayerStorageValue(cid, 5000)-1) and doPlayerSendTextMessage(cid, 20, "You have " .. getPlayerStorageValue(cid, 5000) .. " broadcasts left.\nYou have " .. os.date("%H:%M:%S", " .. os.time() .. ") .. " to broadcast another message.")
end
Code:
function onSay(cid, words, param, channel)
	return getPlayerStorageValue(cid, 5001) == 1 and doPlayerSendTextMessage(cid, 20, "You have " .. os.date("%H:%M:%S", " .. os.time() .. ") .. ".") or doPlayerSendCancel(cid, "You dont have any broadcasts left.")
end
 
Last edited:
[15/04/2010 15:42:47] [Error - TalkAction Interface]
[15/04/2010 15:42:47] data/talkactions/scripts/b1.lua:onSay
[15/04/2010 15:42:47] Description:
[15/04/2010 15:42:47] data/talkactions/scripts/b1.lua:2: bad argument #2 to 'date' (number expected, got string)
[15/04/2010 15:42:47] stack traceback:
[15/04/2010 15:42:47] [C]: in function 'date'
[15/04/2010 15:42:47] data/talkactions/scripts/b1.lua:2: in function <data/talkactions/scripts/b1.lua:1>
 
[15/04/2010 15:42:47] [Error - TalkAction Interface]
[15/04/2010 15:42:47] data/talkactions/scripts/b1.lua:onSay
[15/04/2010 15:42:47] Description:
[15/04/2010 15:42:47] data/talkactions/scripts/b1.lua:2: bad argument #2 to 'date' (number expected, got string)
[15/04/2010 15:42:47] stack traceback:
[15/04/2010 15:42:47] [C]: in function 'date'
[15/04/2010 15:42:47] data/talkactions/scripts/b1.lua:2: in function <data/talkactions/scripts/b1.lua:1>
wattttttt, i edited my post 3 times
 
[15/04/2010 15:58:24] [Error - TalkAction Interface]
[15/04/2010 15:58:24] data/talkactions/scripts/b2.lua:onSay
[15/04/2010 15:58:24] Description:
[15/04/2010 15:58:24] data/talkactions/scripts/b2.lua:2: bad argument #2 to 'date' (number expected, got string)
[15/04/2010 15:58:24] stack traceback:
[15/04/2010 15:58:24] [C]: in function 'date'
[15/04/2010 15:58:24] data/talkactions/scripts/b2.lua:2: in function <data/talkactions/scripts/b2.lua:1>
 
Code:
function onSay(cid, words, param, channel)
	return getPlayerStorageValue(cid, 5000) <= 15 and os.time() >= getPlayerStorageValue(cid, 5001) + 300 and doBroadcastMessage(getCreatureName(cid) .. " [" .. getPlayerLevel(cid) .. "]: " .. param) and setPlayerStorageValue(cid, 5001, os.time()) and setPlayerStorageValue(cid, 5000, getPlayerStorageValue(cid, 5000)-1) and doPlayerSendTextMessage(cid, 20, "You have " .. getPlayerStorageValue(cid, 5000) .. " broadcasts left.\nYou have " .. os.date("%H:%M:%S", os.time()) .. " to broadcast another message.")
end

? ;d
 
Last edited:
Code:
function onSay(cid, words, param, channel)
	return tonumber(getPlayerStorageValue(cid, 5000)) <= 15 and os.time() >= tonumber(getPlayerStorageValue(cid, 5001) + 300) and doBroadcastMessage(getCreatureName(cid) .. " [" .. getPlayerLevel(cid) .. "]: " .. param) and setPlayerStorageValue(cid, 5001, os.time()) and setPlayerStorageValue(cid, 5000, getPlayerStorageValue(cid, 5000)-1) and doPlayerSendTextMessage(cid, 20, "You have " .. getPlayerStorageValue(cid, 5000) .. " broadcasts left.\nYou have " .. os.date("%H:%M:%S", os.time()) .. " to broadcast another message.")
end

? ;d

Works -.^
 
Pleas ehlp me with this

Code:
function onSay(cid, words, param, channel)
	return getPlayerStorageValue(cid, 5000) == 1 and doPlayerSendTextMessage(cid, 20, "You have " .. os.date("%H:%M:%S", " .. os.time() .. ") .. ".") or doPlayerSendCancel(cid, "You dont have any broadcasts left.")
end

Is the command !broadcastinfo, when you say the command says You have ... broadcasts left. Next broadcast in 5 minutes.

(ITS FOR CHECK CONSTANTLY YOUR BROADCAST INFO)
 
Code:
function onSay(cid, words, param, channel)
	return getPlayerStorageValue(cid, 5000) == 1 and doPlayerSendTextMessage(cid, 20, "You have " .. os.date("%H:%M:%S", os.time()) ..".") or doPlayerSendCancel(cid, "You dont have any broadcasts left.")
end

@edit:
Well, i just checked getCreatureStorage if value can be converted to int it pushes int, if not then string so u don't beed tonumber() in each getPlayerStorageValue(), just fix os.date() with wrong #2 param. I removed unnecessary tonumber()'s in my posts.
 
Last edited:
Pleas ehlp me with this

Code:
function onSay(cid, words, param, channel)
	return getPlayerStorageValue(cid, 5000) == 1 and doPlayerSendTextMessage(cid, 20, "You have " .. os.date("%H:%M:%S", " .. os.time() .. ") .. ".") or doPlayerSendCancel(cid, "You dont have any broadcasts left.")
end

Is the command !broadcastinfo, when you say the command says You have ... broadcasts left. Next broadcast in 5 minutes.

(ITS FOR CHECK CONSTANTLY YOUR BROADCAST INFO)
Code:
function onSay(cid, words, param, channel)
	return getPlayerStorageValue(cid, 5000) == 1 and doPlayerSendTextMessage(cid, 20, "You have " .. os.date("%H:%M:%S", os.time()) .. " or doPlayerSendCancel(cid, "You dont have any broadcasts left.")
end
 
Back
Top