-- Script 100% by Colandus
local levelReq = 150 -- Level needed to use the command.
local minChars = 5 -- How many characters may you write as minumum?
local basePrice = 0 -- Base price, will be multiplied with the price made by a formula in the script.
-- Exhaustion Settings
local useExhaust = true
local storageValue = 3435
local exhaustTime = 1 * 60 -- 1 minute
--[[ Example:
You are level 100 and you are going to write a sentence of 45 characters with base price 1000.
1000 + (100 * 5) =
1000 + 500 = 1500
1500 * 45 = 67500
The message of 45 characters, broadcasted by a level 100 with the base price as 1000 would cost the player 67500 gold (67.5k),.
]]--
function onSay(cid, words, param)
local letterPrice = basePrice + getPlayerLevel(cid) * 2
local broadcastPrice = letterPrice * param:len()
if getPlayerLevel(cid) < levelReq then
doPlayerSendCancel(cid,"disculpa, pero necesitas lvl " .. levelReq .. " para usar este comandos.")
elseif (useExhaust and isExhausted(cid, storageValue, exhaustTime) == TRUE) then
doPlayerSendCancel(cid, "debes esperar antes de tirar otro mensaje.")
elseif param:len() < minChars then
doPlayerSendCancel(cid,"disculpa debes escribir minimo " .. minChars .. "letras, cada letra te cuesta " .. letterPrice .. " gps.")
else
doPlayerSendTextMessage(cid, 24, "mensaje enviado al server")
broadcastMessage(getPlayerName(cid) .. " [" .. getPlayerLevel(cid) .. "]: " .. param, MESSAGE_STATUS_CONSOLE_ORANGE)
setExhaust(cid, storageValue)
end
end