Ir para conteúdo
  • 0

Adicionar tempo para uso


narutomaniacos

Pergunta

Preciso de ajuda para adicionar tempo entre usos dessa talkaction.

Script:

--[[Script By Vodkart]]--function onSay(cid, words, param)local config = {pz = False, -- players precisam estar em protection zone para usar? (true or false)battle = true, -- players deve estar sem battle (true or false)custo = true, -- se os teleport irão custa (true or false)need_level = true, -- se os teleport irão precisar de level (true or false)premium = true -- se precisa ser premium account (true or false)}--[[ Config lugares]]--local lugar = {["depot"] = { -- nome do lugarpos = {x=129, y=54, z=6},level = 5,price = 1000},["templo"] = { -- nome do lugarpos = {x=160, y=54, z=7},level = 10, price = 2000},["arena"] = { -- nome do lugarpos = {x=125, y=351, z=9},level = 15,price = 3000},["area vip"] ={ -- nome do lugarpos = {x=280, y=87, z=4},level = 20,price = 4000}}--[[ Lista de Viagem (Não mexa) ]]--if (param == "lista") thenlocal str = ""str = str .. "lista de viagem :\n\n"for name, pos in pairs(lugar) dostr = str..name.."\n"endstr = str .. ""doShowTextDialog(cid, 6579, str)return TRUEendlocal a = lugar[param]if not(a) thendoPlayerSendTextMessage(cid, 22, "desculpe,este lugar não existe")doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)return TRUEelseif config.pz == true and getTilePzInfo(getCreaturePosition(cid)) == FALSE thendoPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"você precisa estar em protection zone pra poder teleportar.")return TRUEelseif config.premium == true and not isPremium(cid) thendoPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas players com premium account podem teleportar.")return TRUEelseif config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE thendoPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você precisa estar sem battler pra poder teleportar.")return TRUEelseif config.need_level == true and getPlayerLevel(cid) < a.level thendoPlayerSendTextMessage(cid, 22, "Desculpe,Voce não tem level. voce precisa "..a.level.." level ou mais para ser teleportado.")doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)return TRUEelseif config.custo == true and doPlayerRemoveMoney(cid, a.price) == FALSE thendoPlayerSendTextMessage(cid, 22, "Desculpe,voce nao tem dinheiro suficiente. Voce precisa "..a.price.." gp para ser teleportado.")doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)return TRUEenddoTeleportThing(cid, a.pos)doSendMagicEffect(a.pos, CONST_ME_TELEPORT)doPlayerSendTextMessage(cid, 22, "" .. getPlayerName(cid) .. " foi teleportado para: \n " .. param .. ".")return TRUEend
Protocolo: 0.3.6

 

up

Editado por narutomaniacos
Link para o comentário
Compartilhar em outros sites

9 respostass a esta questão

Posts Recomendados

  • 0
  • Diretor

Cara so acho que você deveria organizar mais o tópico e a script para facilitar kkkk

 

Bom estou meio com pressa aqui, então editei a script aqui para você rapidão. Teste ai...

--[[script By Vodkart]]--function onSay(cid, words, param)if getPlayerStorageValue(cid, 212193) > os.time() then        return doPlayerSendCancel(cid, "Espere " .. getPlayerStorageValue(cid, 212193) - os.time() .. " segundos.")    endlocal config = {pz = False, -- players precisam estar em protection zone para usar? (true or false)battle = true, -- players deve estar sem battle (true or false)custo = true, -- se os teleport irão custa (true or false)need_level = true, -- se os teleport irão precisar de level (true or false)premium = true -- se precisa ser premium account (true or false)}--[[ Config lugares]]--local lugar = {["depot"] = { -- nome do lugarpos = {x=129, y=54, z=6},level = 5,price = 1000},["templo"] = { -- nome do lugarpos = {x=160, y=54, z=7},level = 10, price = 2000},["arena"] = { -- nome do lugarpos = {x=125, y=351, z=9},level = 15,price = 3000},["area vip"] ={ -- nome do lugarpos = {x=280, y=87, z=4},level = 20,price = 4000}}--[[ Lista de Viagem (Não mexa) ]]--if (param == "lista") thenlocal str = ""str = str .. "lista de viagem :\n\n"for name, pos in pairs(lugar) dostr = str..name.."\n"endstr = str .. ""doShowTextDialog(cid, 6579, str)return TRUEendlocal a = lugar[param]if not(a) thendoPlayerSendTextMessage(cid, 22, "desculpe,este lugar não existe")doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)return TRUEelseif config.pz == true and getTilePzInfo(getCreaturePosition(cid)) == FALSE thendoPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"você precisa estar em protection zone pra poder teleportar.")return TRUEelseif config.premium == true and not isPremium(cid) thendoPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas players com premium account podem teleportar.")return TRUEelseif config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE thendoPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você precisa estar sem battler pra poder teleportar.")return TRUEelseif config.need_level == true and getPlayerLevel(cid) < a.level thendoPlayerSendTextMessage(cid, 22, "Desculpe,Voce não tem level. voce precisa "..a.level.." level ou mais para ser teleportado.")doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)return TRUEelseif config.custo == true and doPlayerRemoveMoney(cid, a.price) == FALSE thendoPlayerSendTextMessage(cid, 22, "Desculpe,voce nao tem dinheiro suficiente. Voce precisa "..a.price.." gp para ser teleportado.")doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)return TRUEenddoTeleportThing(cid, a.pos)doSendMagicEffect(a.pos, CONST_ME_TELEPORT)doPlayerSendTextMessage(cid, 22, "" .. getPlayerName(cid) .. " foi teleportado para: \n " .. param .. ".")setPlayerStorageValue(cid, 212193, os.time() + 30) -- tempo em segundos.return TRUEend

 

Editado por nedroesdoksdja
Link para o comentário
Compartilhar em outros sites

  • 0

deve ser por isso que ninguém me ajudou kk não me expressei bem, agora editei esta mais direto. eu gostaria de por tempo entre usos do script, tenho noção de scipt mas não ser fazer códigos, acho que daria pra fazer adicionando storage por x tempo, não sei :x

Link para o comentário
Compartilhar em outros sites

  • 0

Esta na area errada, não tem como dar melhor resposta, gostaria de saber como fazer para aparecer espere x minutos para usar novamente do que "300 segundos" de qualquer forma obrigado, reportado para que movam para a area certa.

Link para o comentário
Compartilhar em outros sites

  • 0
  • Diretor

Putz ai você quer forçar a amizade né amigo?

 

Estou viajando e não tenho um servidor para testar, pois não sei a forma correta de por em minutos por isso precisaria de um servidor para testar antes de mandar para você.

 

Você poderia mudar a mensagem também para ficar mais fácil "Você pode usar este comando apenas uma vez por 3 minutos." rsrs

 

Mais creio que adicionando um +param*60... Daria certo.

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...