Ir para conteúdo
  • 0

Vocação Por Resets


Adriez

Pergunta

boa noite galera, como faço isso pra isso requisitar 5 resets pra poder resetar e muda de vocação

 

FUNÇÃO DO MEU RESET

 

function onSay(cid, words, param)

local storagedotekpokk = 9697
function getTime(s)
local n = math.floor(s / 60)
s = s - (60 * n)
return n, s
end

local tempo = 10

if os.time()-getPlayerStorageValue(cid, storagedotekpokk) <= tempo*60 then
minutes,seconds = getTime(tempo*60-(os.time()-getPlayerStorageValue(cid, storagedotekpokk)))
return doPlayerSendTextMessage(cid,4, "Vc precisa espera " .. minutes .. " minutos para usa isso ai denovo manolo kkkkkkkkkkkk.")
end

if words =="!resetar" then

setPlayerStorageValue(cid, storagedotekpokk, os.time())

 

Spoiler

function onSay(cid, words, param, channel)
local tabble = {
["promo"] = {reqVoc= nil, needLevel=10000},
}
local param,config = string.lower(param),{pid = getPlayerGUID(cid),newlv = 8,life = 185,mana = 35}
if not tabble[param] then
doPlayerPopupFYI(cid, "O comando correto é !mixed promo.") return true
elseif getTilePzInfo(getCreaturePosition(cid)) == false then
doPlayerPopupFYI(cid, "Você precisa estar em pz para resetar.") return true
elseif getPlayerLevel(cid) < tabble[param].needLevel then
doPlayerPopupFYI(cid, "You need be "..tabble[param].needLevel.." level or more.") return true
elseif tabble[param].reqVoc == nil and getPlayerStorageValue(cid, 887978) >= 1 then
doPlayerPopupFYI(cid, "Você já virou mixed.") return true
elseif tabble[param].reqVoc ~= nil and getPlayerVocation(cid) ~= tabble[param].reqVoc then
doPlayerPopupFYI(cid, "You dont have the required vocation.") return true
end
if tabble[param].reqVoc == nil then setPlayerStorageValue(cid, 887978, 1) end
local newvoc = tabble[param].reqVoc ~= nil and (tabble[param].reqVoc+1) or 5
setPlayerStorageValue(cid, 887979, newvoc)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = "..config.newlv..", `experience` = "..getExperienceForLevel(config.newlv)..",`manamax` = "..config.mana..",`health` = "..config.life..", `healthmax` = "..config.life..",`mana` = "..config.mana.." WHERE `id` = "..config.pid)
return true
end

 

Link para o comentário
Compartilhar em outros sites

0 respostass a esta questão

Posts Recomendados

Até agora não há respostas para essa pergunta

×
×
  • Criar Novo...