If a player has premium account, he can broadcast every five minutes.
Credit to Keraxel for helping me with exhaust :thumbup:
Credit to Keraxel for helping me with exhaust :thumbup:
PHP:
-- by mpa 2009-02-07
function onSay(cid, words, param)
local exhaustTime = 5 * 60
local message = "" .. getCreatureName(cid) .. " [" .. getPlayerLevel(cid) .. "]: " .. param .. ""
if exhaustion.check(cid, 8860) == TRUE then
doPlayerSendCancel(cid, "Sorry, you may only broadcast once every 5 minutes.")
return TRUE
end
if isPremium(cid) == TRUE then
if (exhaustion.make(cid, 8860, exhaustTime)) == TRUE then
doBroadcastMessage(cid, "" ..message.. "", MESSAGE_EVENT_ADVANCE)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Broadcast sent.")
else
doPlayerSendCancel(cid, "Sorry, you may only broadcast once every 5 minutes.")
end
end
return TRUE
end