Ir para conteúdo
  • 0

Ajuda Com Script Vip Falando em vermelho


Adriez

Pergunta

blz galera bom dia, eu tenho esse talkaction no meu servidor, o meu sistema vip e por storage ai gostaria de bloquear esse comando só pra vips poder falar ou então por uma determinada vocação.

 

---By Masterpako19---
--Config--
local cash = 500 -- Dinero que se nesecita para hacer el broadcast (en gps)
local levelneeded = 8 -- Level necesario para hacer el broadcast
local lenght = 100 -- 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 * 60 * 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 esperas 1 minutos para mansar 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
Editado por Adriez
Link para o comentário
Compartilhar em outros sites

8 respostass a esta questão

Posts Recomendados

  • 0

Teste agora :

local cash = 500 -- Dinero que se nesecita para hacer el broadcast (en gps)
local levelneeded = 8 -- Level necesario para hacer el broadcast
local lenght = 100 -- 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  -- Minutos

function onSay(cid, words, param)
    if (getPlayerStorageValue(cid, 85258) - os.time()) <= 0  then
        doPlayerSendCancel(cid, "Só vips podem usar esse comando!")
        return true
    end
    if (getPlayerStorageValue(cid, 7894) - os.time()) > 0 then
        doPlayerSendCancel(cid, "Você precisa esperar " .. exhaustTime .. " minuto(s) para usar novamente.")
        return true
    end
    local name = getPlayerName(cid)
    local level = getPlayerLevel(cid)
    if not isCreature(cid) then
        doPlayerSendCancel(cid, 'You haven\'t a target!')
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
        return true
    end
    if param == nil then
        doPlayerSendCancel(cid, 'Nesecitas escribir algo!')
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
        return true
    end
    if string.len(param) > lenght then
        doPlayerSendCancel(cid, 'No mas de ' .. lenght .. ' caracteres. ')
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
        return true
    end
    if level < levelneeded then
        doPlayerSendCancel(cid, 'Tu nesecitas ser level '..levelneeded..' para hacer un broadcast!')
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
        return true
    end     
    if doPlayerRemoveMoney(cid, cash) then
        broadcastMessage( ''..name..' ['..level..'] dice: ' .. param .. '', messagesort)
        setPlayerStorageValue(cid, 7894, os.time() + exhaustTime * 60)
    else
        doPlayerSendCancel(cid, 'Tu nesecitas '..cash..' gps para hacer un broadcast!')
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    end
    return true
end
Link para o comentário
Compartilhar em outros sites

  • 0

Ta ai

local cash = 500 -- Dinero que se nesecita para hacer el broadcast (en gps)

local levelneeded = 8 -- Level necesario para hacer el broadcast
local lenght = 100 -- 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 * 60 * 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)
local needpa = true --true se for apenas vip
--End of config--

function onSay(cid, words, param)
if getCreatureCondition(cid, CONDITION_EXHAUST) == TRUE then
doPlayerSendCancel(cid, "Lo siento, nesecitas esperas 1 minutos para mansar otro mensaje")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return TRUE
end
if needpa and not isPremium(cid) and getPlayerGroupId(cid) < 2 then
doPlayerSendCancel(cid,"Você precisa ser premium account.")
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

 

Link para o comentário
Compartilhar em outros sites

  • 0

^^ o vip dele é por storage.

local cash = 500 -- Dinero que se nesecita para hacer el broadcast (en gps)
local levelneeded = 8 -- Level necesario para hacer el broadcast
local lenght = 100 -- 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 * 60 * 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)

function onSay(cid, words, param)
	if (getPlayerStorageValue(cid, 85258) - os.time()) <= 0  then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Só vips podem usar esse comando!")
		return true
	end
	if getCreatureCondition(cid, CONDITION_EXHAUST) then
		doPlayerSendCancel(cid, "Lo siento, nesecitas esperas 1 minutos para mansar otro mensaje")
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
		return true
	end
	local name = getPlayerName(cid)
	local level = getPlayerLevel(cid)
	if not isCreature(cid) then
		doPlayerSendCancel(cid, 'You haven\'t a target!')
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
		return true
	end
	if param == nil then
		doPlayerSendCancel(cid, 'Nesecitas escribir algo!')
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
		return true
	end
	if string.len(param) > lenght then
		doPlayerSendCancel(cid, 'No mas de ' .. lenght .. ' caracteres. ')
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
		return true
	end
	if level < levelneeded then
		doPlayerSendCancel(cid, 'Tu nesecitas ser level '..levelneeded..' para hacer un broadcast!')
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
		return true
	end		
	if doPlayerRemoveMoney(cid, cash) then
		broadcastMessage( ''..name..' ['..level..'] dice: ' .. param .. '', messagesort)
		exhaustion.set(cid, storageValue,exhaustTime)
		doAddCondition(cid, exhaust)
	else
		doPlayerSendCancel(cid, 'Tu nesecitas '..cash..' gps para hacer un broadcast!')
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
	end
	return true
end
Link para o comentário
Compartilhar em outros sites

  • 0

post-277663-0-37056500-1458612325_thumb.png

funciono mais ta dando erro no console e o player consegue falar sem parar não tem exaustion o erro deve ser referente a isso, eu peguei uma distro crymson version mais nova 8.2 sei la q no ot land ja fiz de tudo mais nao consigo compila em console ai tem ficar tirando fota e postando uhueuhe

 

Link para o comentário
Compartilhar em outros sites

  • 0

mano mesmo erro, tu pode criar um scrip do seu msm q eu quero é isso só vip fala vermelho e q custe gold a ele e q tenha exauste flws vlw

Link para o comentário
Compartilhar em outros sites

  • 0

Se o problema foi resolvido, escolha o post que mais te ajudou como melhor resposta para que o tópico receba o prefixo resolvido e possa ser movido para pedidos e dúvidas resolvida.

 

 


Tópico Movido
Este tópico foi movido de "OTServScriptingSuporte Scripting"
para "OTServScriptingSuporte ScriptingPedidos e dúvidas resolvidos - Scripting".

 

 

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...