Hokku
Member
Hello!
Here is a player broadcast system working on TFS 1.1 by Mark Samman, min level, broadcast price, time betwen broadcasts, and how it is displayed in chat can be configured. I didnt made this script, just took and modified to work in TFS 1.1.
data/talkactions/scripts/broadcast22.lua
data/talkactions.xml
<talkaction words="/all" separator=" " script="broadcast22.lua"/>
Enjoy!
Here is a player broadcast system working on TFS 1.1 by Mark Samman, min level, broadcast price, time betwen broadcasts, and how it is displayed in chat can be configured. I didnt made this script, just took and modified to work in TFS 1.1.
data/talkactions/scripts/broadcast22.lua
Code:
local config = {
storage = 19400, -- change to an non used storage if u use it
cor = "advance", -- No working on TFS 1.1, edit line 21 param
tempo = 2, -- in minutes
price = 1000, -- price of each bc
level = 100 -- lvl requiered to use bc
}
function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return true
end
if getPlayerLevel(cid) >= config.level then
if getPlayerStorageValue(cid, config.storage) - os.time() <= 0 then
if doPlayerRemoveMoney(cid, config.price) then
setPlayerStorageValue(cid, config.storage, os.time() + (config.tempo*60))
Game.broadcastMessage("[ALL] "..getCreatureName(cid)..": "..param.."", MESSAGE_STATUS_CONSOLE_ORANGE)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You have successfully sent a broadcast, now you'll have to wait " ..config.tempo.. " minute(s) until you broadcast again.")
else
doPlayerSendCancel(cid, "You don't have " ..config.price.. " gp's for broadcasting.")
return true
end
else
doPlayerSendCancel(cid, "You have to wait " ..(getPlayerStorageValue(cid, config.storage) - os.time()).. " seconds until you can broadcast again.")
return true
end
else
doPlayerSendCancel(cid, "You have to be level " ..config.level.. " or more in order to use broadcast.")
end
end
data/talkactions.xml
<talkaction words="/all" separator=" " script="broadcast22.lua"/>
Enjoy!