• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Broadcast by letter

azav3

New Member
Joined
Apr 14, 2012
Messages
12
Reaction score
0
I have the script !bc in my server and players use it to speak in red to everybody. It works good, but I want sthing different:
I want that the scripts remove 5k for EACH letter, space or symbol do you write, for example:
Actual Script: !bc A looooooooooooooooooong example for otlaaand!!!!!!.
Price: 7 CC
Actual Script: !bc Something short.
Price: 7 CC

I want this:
New Script: !bc hiho! example!
Price: 14 letters, space or symbols. So, 14 x 5k = 70k. So 7 CC
New Script: !bc Short
Price: 5 x 5k = 25k
 
I have the script !bc in my server and players use it to speak in red to everybody. It works good, but I want sthing different:
I want that the scripts remove 5k for EACH letter, space or symbol do you write, for example:
Actual Script: !bc A looooooooooooooooooong example for otlaaand!!!!!!.
Price: 7 CC
Actual Script: !bc Something short.
Price: 7 CC

I want this:
New Script: !bc hiho! example!
Price: 14 letters, space or symbols. So, 14 x 5k = 70k. So 7 CC
New Script: !bc Short
Price: 5 x 5k = 25k

I think this would work:
LUA:
doPlayerRemoveMoney(cid, string.len(' .. parameter .. ') * 5000)
just change "parameter" to whatever is configured to be the parameter of your talkaction

if you are having troubles, please post your scripts here, so maybe I or someone else might be able to help = )
 
Here is the original script:
LUA:
---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

I would like if you can edit for me. I'm very noob in lua. Please!
 
Here is the original script:
LUA:
---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

I would like if you can edit for me. I'm very noob in lua. Please!

This should work just fine:
LUA:
---By Masterpako19---
 
--Config--
 
local cash = 5000 -- 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, string.len(param) * 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
Hope it helps...
If it doesn't work please send me the error and I'll try to fix it for you =)


---- edit
On "cash" you should put the price per letter = )
 
Back
Top