PO
pedido

Restrição De Storage

Por popohat7, 29 de nov. de 2012 em Scripts

9
1.1k
popohat7P
29 de novembro de 2012 às 23:54

Olá, alguém poderia adicionar requerimento de uma storage para usar essas 2 talkactions ?

 

function onSay(cid, words, param)

local wait = 60 -- Tempo em segundos

local creature = getCreatureTarget(cid)

local pos = getThingPos(cid)

if exhaustion.check(cid, 3719) then

doPlayerSendCancel(cid, "Aguarde "..exhaustion.get(cid, 3719).." segundos para usar o comando novamente.") return true

elseif creature < 1 then

doPlayerSendCancel(cid,"Você precisa selecionar o alvo.") return true

end

doSendDistanceShoot(pos,getThingPos(creature),38)

doSendMagicEffect(getThingPos(creature),3)

doPushCreature(creature,getPlayerLookDir(cid))

exhaustion.set(cid, 3719, wait)

return true

end

 

function onSay(cid, words, param)

local waittime = 20 -- Tempo de exhaustion

local storage = 5560

local pos = getCreaturePosition(cid)

local from = {x=pos.x, y=pos.y, z=pos.z}

local to = {x = 1136, y = 242, z = 7} -- Onde sera teleportado outra dimensao

local area1 = {x = 1134, y = 240, z = 7} -- Ponta de cima na esquerda

local area2 = {x = 1138, y = 244, z = 7} -- Ponta de baixo na direita

local ppos = getCreaturePosition(cid)

local level = 100 -- Level necessário

if getPlayerLevel(cid) < level then

doPlayerSendCancel(cid, "Você precisa de level "..level.." para usar essa magia.")

return true

end

function back(cid)

if isInArea(getCreaturePosition(cid), area1, area2) then

doTeleportThing(cid, from)

end

end

function go(cid)

if isInArea(getCreaturePosition(cid), from, from) then

doTeleportThing(cid, to)

end

end

if exhaustion.check(cid, storage) == false then

for _, pid in ipairs(getPlayersOnline()) do

addEvent(back, 5000, pid) -- Tempo para retornar (1000 = 1 seg)

addEvent(go, 1, pid)

doSendMagicEffect(getCreaturePosition(pid), 63)

doCreatureSay(pid, "Change Dimension!", TALKTYPE_MONSTER) --- Mensagem

addEvent(setPlayerStorageValue, 10000, pid, 1634, -1)

end

exhaustion.set(cid, storage, waittime)

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar a spell novamente.")

end

return true

end

 

Grato, na espera.

Editado Novembro 30 por SkyDevilFire

LuckOakeL
30 de novembro de 2012 às 00:07

A primeira já respondi no outro tópico.

 

A segunda, que é um script de minha autoria, não tem verificação de VIP em lugar nenhum. Tem certeza que está usando corretamente?

popohat7P
30 de novembro de 2012 às 00:09

Desculpe... esse tá limpo é que o vodkart tinha editado para mim, pondo apenas vip kidray para utilizar ai confundi =)

 

Esse post é para fazer outra coisa =)

Editado Novembro 30 por SkyDevilFire

LuckOakeL
30 de novembro de 2012 às 00:14

Então você quer é que seja necessário uma storage pra usar, certo?

 

Tó:

 

 

function onSay(cid, words, param)
local waittime = 20 -- Tempo de exhaustion
local storage = 5560
local nstor = 1379 -- Storage Necessária
local value = 1 -- Valor necessário
local pos = getCreaturePosition(cid)
local from = {x=pos.x, y=pos.y, z=pos.z}
local to = {x = 1136, y = 242, z = 7} -- Onde sera teleportado outra dimensao
local area1 = {x = 1134, y = 240, z = 7} -- Ponta de cima na esquerda
local area2 = {x = 1138, y = 244, z = 7} -- Ponta de baixo na direita
local ppos = getCreaturePosition(cid)
local level = 100 -- Level necessário

if getPlayerStorageValue(cid, nstor) < value then
doPlayerSendCancel(cid, "Você não pode usar essa magia.") return true
elseif getPlayerLevel(cid) < level then
doPlayerSendCancel(cid, "Você precisa de level "..level.." para usar essa magia.") return true
end
function back(cid)
if isInArea(getCreaturePosition(cid), area1, area2) then
doTeleportThing(cid, from)
end
end
function go(cid)
if isInArea(getCreaturePosition(cid), from, from) then
doTeleportThing(cid, to)
end
end
if exhaustion.check(cid, storage) == false then
for _, pid in ipairs(getPlayersOnline()) do
addEvent(back, 5000, pid) -- Tempo para retornar (1000 = 1 seg)
addEvent(go, 1, pid)
doSendMagicEffect(getCreaturePosition(pid), 63)
doCreatureSay(pid, "Change Dimension!", TALKTYPE_MONSTER) --- Mensagem
addEvent(setPlayerStorageValue, 10000, pid, 1634, -1)
end
exhaustion.set(cid, storage, waittime)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar a spell novamente.")
end
return true
end

 

 

Configure aqui:

 

local nstor = 1379 -- Storage Necessária
local value = 1 -- Valor necessário

Editado Novembro 30 por LuckOake

popohat7P
30 de novembro de 2012 às 00:22

Isso mesmo, faltou a otra tem como por, ? Agradecido.

LuckOakeL
30 de novembro de 2012 às 00:24

Tó:

 

 

function onSay(cid, words, param)
local wait = 60 -- Tempo em segundos
local creature = getCreatureTarget(cid)
local pos = getThingPos(cid)
local nstor = 1379 -- Storage Necessária
local value = 1 -- Valor necessário

if getPlayerStorageValue(cid, nstor) < value then
doPlayerSendCancel(cid, "Você não pode usar esse comando.") return true
elseif exhaustion.check(cid, 3719) then
doPlayerSendCancel(cid, "Aguarde "..exhaustion.get(cid, 3719).." segundos para usar o comando novamente.") return true
elseif creature < 1 then
doPlayerSendCancel(cid,"Você precisa selecionar o alvo.") return true
end

doSendDistanceShoot(pos,getThingPos(creature),38)
doSendMagicEffect(getThingPos(creature),3)
doPushCreature(creature,getPlayerLookDir(cid))
exhaustion.set(cid, 3719, wait)
return true
end

 

 

Configure aqui:

local nstor = 1379 -- Storage Necessária
local value = 1 -- Valor necessário

popohat7P
30 de novembro de 2012 às 00:27

Man, só uma duvida =) Esse valor é oque ? Grato , Boa noite man !

LuckOakeL
30 de novembro de 2012 às 00:36

Exemplo:

 

A pessoa só vai poder usar a talk se tiver o storage 1379 no valor 1.

popohat7P
30 de novembro de 2012 às 07:50

Funfo certinho, obrigado =)

Editado Dezembro 1 por SkyDevilFire