• 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 Script for tfs 0.4

kito2

www.masteria.net
Joined
Mar 9, 2009
Messages
3,766
Solutions
1
Reaction score
225
Location
Chile, Santiago
I have been searching for a lot of time, but nothing that works fine...

I need a broadcast talkactions that has a basecost for each letter...

Could someone make one please?

I rep++

Thanks.
 
Last edited:
omg mi competencia
revisa en otfans el script de colandus creo que lo tiene en su firma el link

aunque como soy paleta te doy el que tengo yo


Code:
-- 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
en mi script no cobra por mandar los broadcast solo pide el lvl y el exausted es de 1 minuto pero el broadcast se manda en letras naranjas y solo sale en console por el spamm si lo quieres de otra forma cambia el tipo de mensaje y coloca el removemoney price y wea

acuerdate del exaustion

Code:
exhaustion =
{
	check = function (cid, storage)
		if(getPlayerStorageValue(cid, storage) >= os.time(t)) then
			return TRUE
		end

		return FALSE
	end,

	get = function (cid, storage)
		local exhaust = getPlayerStorageValue(cid, storage)
		if(exhaust > 0) then
			local left = exhaust - os.time(t)
			if(left >= 0) then
				return left
			end
		end

		return FALSE
	end,

	set = function (cid, storage, time)
		setPlayerStorageValue(cid, storage, os.time(t) + time)
	end,

	make = function (cid, storage, time)
		local exhaust = exhaustion.get(cid, storage)
		if(not exhaust) then
			exhaustion.set(cid, storage, time)
			return TRUE
		end

		return FALSE
	end
}
es o va en tu lib

xd

PD: http://otfans.net/showthread.php?t=112209
 
Back
Top