---By Masterpako19---
--Config--
local cash = 70000 -- Dinero que se nesecita para hacer el broadcast (en gps)
local levelneeded = 100 -- Level necesario para hacer el broadcast
local lenght = 300 -- Maximo de caracteres del mensaje
local messagesort = MESSAGE_STATUS_WARNING -- can be "MESSAGE_STATUS_WARNING" or "TALKTYPE_ORANGE_1" check your global.lua for more...
local exhaustTime = 1 * 10 * 1000 -- tiempo de exausted entre cada mensaje (para cambiar mas minutos cambia el 4 por x cantidad de minutos)
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, exhaustTime)
--End of config--
function onSay(cid, words, param)
if getCreatureCondition(cid, CONDITION_EXHAUST) == TRUE then
doPlayerSendCancel(cid, "Lo siento, nesecitas esperar 10 segundos para mandar otro mensaje")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return TRUE
end
local name = getPlayerName(cid)
local level = getPlayerLevel(cid)
if isCreature(cid) == TRUE then
if param ~= nil then
if string.len(param) < lenght then
if level >= levelneeded then
if doPlayerRemoveMoney(cid, cash) == TRUE then
broadcastMessage( ''..name..' ['..level..'] dice: ' .. param .. '', messagesort)
--exhaustion.set(cid, storageValue,exhaustTime)
doAddCondition(cid, exhaust)
return TRUE
else
doPlayerSendCancel(cid, 'Tu nesecitas '..cash..' gps para hacer un broadcast!')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return TRUE
end
else
doPlayerSendCancel(cid, 'Tu nesecitas ser level '..levelneeded..' para hacer un broadcast!')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return TRUE
end
else
doPlayerSendCancel(cid, 'No mas de ' .. lenght .. ' caracteres. ')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return TRUE
end
else
doPlayerSendCancel(cid, 'Nesecitas escribir algo!')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return TRUE
end
else
doPlayerSendCancel(cid, 'You haven\'t a target!')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return TRUE
end
return TRUE
end