Postado Julho 26, 2013 11 anos Autor @keilost testei seu script e deu o erro na foto que anexei junto ao post, olha ai.. @ricardo3 o seu script ta assim: -- vip quest function onUse(cid, item, fromPosition, itemEx, toPosition) local config={ removeOnUse = "no" -- remover quando usar ("yes" or "no") } local minutes = 1 -- dias que serão adicionados local minutesvalue = 60 * 1000 local storageplayer = getPlayerStorageValue(cid, 13540) local timenow = os.time() if getPlayerStorageValue(cid, 13540) - os.time() <= 0 then time = timenow + minutesvalue else time = storageplayer + minutesvalue end setPlayerStorageValue(cid, 13540, time) local minutes = math.floor((getPlayerStorageValue(cid, 13540) - timenow)/(24 * 60 * 60)) doSendMagicEffect(getPlayerPosition(cid), math.random(28,30)) if (config.removeOnUse == "yes") then doRemoveItem(item.uid, 1) end if item.uid == 13540 then queststatus = getPlayerStorageValue(cid,13545) if queststatus == -1 then doPlayerSendTextMessage(cid,22,"You have found a Great Shield and Dragon Scale Legs.") setPlayerStorageValue(cid,13545,1) else doPlayerSendTextMessage(cid,22,"Vazio.") end else return 0 end return 1 end Editado Julho 26, 2013 11 anos por Disturbbed (veja o histórico de edições)
Postado Julho 26, 2013 11 anos Ó estou aqui para ajudar... já que o script nao é compátivel com o seu system de VIP faça o seguinte.. instale o Mock sem retirar o seu.. e troque o script por este -- vip quest function onUse(cid, item, fromPosition, itemEx, toPosition) local minutes = 1 -- dias que serão adicionadoslocal minutesvalue = 60 * 1000local storageplayer = getPlayerStorageValue(cid, 13540)local timenow = os.time() if getPlayerStorageValue(cid, 13540) - os.time() <= 0 thentime = timenow + minutesvalueelsetime = storageplayer + minutesvalueend setPlayerStorageValue(cid, 13540, time)local minutes = math.floor((getPlayerStorageValue(cid, 13540) - timenow)/(24 * 60 * 60))doSendMagicEffect(getPlayerPosition(cid), math.random(28,30))end if item.uid == 13540 then queststatus = getPlayerStorageValue(cid,13545) if queststatus == -1 then doPlayerSendTextMessage(cid,22,"Você recebeu DIAS de VIP.") setPlayerStorageValue(cid,13545,1) else doPlayerSendTextMessage(cid,22,"Você já retirou seus dias de vip.") endelsereturn 0 end return 1end caso der erro mande que tentamos ajustar. para melhor entender mande seu script vip ? Editado Julho 26, 2013 11 anos por ricardo3 (veja o histórico de edições) Ajudei? REP+ http://www.youtube.com/watch?v=xHa6-y2hqrk&feature=youtu.be
Postado Julho 26, 2013 11 anos Autor @Ricardo3 , voce pediu o meu script vip né? é assim: --[[ Name: Vip System by Account Version: 1.0 Author: Kydrai Forum: http://www.tibiaking.com/forum/topic/136543-vip-system-by-account-v10/ [Functions] -- Install installVip() -- By Account doTeleportPlayersByAccount(acc, topos) getVipTimeByAccount(acc) setVipTimeByAccount(acc, time) getVipDaysByAccount(acc) isVipAccount(acc) addVipDaysByAccount(acc, days) doRemoveVipDaysByAccount(acc, days) getVipDateByAccount(acc) -- By Player doTeleportPlayers(cid, topos) getVipTime(cid) setVipTime(cid, time) getVipDays(cid) isVip(cid) addVipDays(cid, days) doRemoveVipDays(cid, days) getVipDate(cid)]]---- Installfunction installVip() if db.executeQuery("ALTER TABLE `accounts` ADD viptime INT(15) NOT NULL DEFAULT 0;") then print("[Vip System] Vip System instalado com sucesso!") return TRUE end print("[Vip System] Não foi possível instalar o Vip System!") return FALSEend-- By Accountfunction doTeleportPlayersByAccount(acc, topos) if db.executeQuery("UPDATE `players` SET `posx` = "..topos.x..", `posy` = "..topos.y..", `posz` = "..topos.z.." WHERE `account_id` = "..acc..";") then return TRUE end return FALSEendfunction getVipTimeByAccount(acc) local vip = db.getResult("SELECT `viptime` FROM `accounts` WHERE `id` = "..acc..";") if vip:getID() == -1 then print("[Vip System] Account not found!") return FALSE end return vip:getDataInt("viptime")endfunction setVipTimeByAccount(acc, time) if db.executeQuery("UPDATE `accounts` SET `viptime` = "..time.." WHERE `id` = "..acc..";") then return TRUE end return FALSEendfunction getVipDaysByAccount(acc) local vipTime = getVipTimeByAccount(acc) local timeNow = os.time() local days = math.ceil((vipTime - timeNow)/(24 * 60 * 60)) return days <= 0 and 0 or daysendfunction isVipAccount(acc) return getVipDaysByAccount(acc) > 0 and TRUE or FALSEendfunction addVipDaysByAccount(acc, days) if days > 0 then local daysValue = days * 24 * 60 * 60 local vipTime = getVipTimeByAccount(acc) local timeNow = os.time() local time = getVipDaysByAccount(acc) == 0 and (timeNow + daysValue) or (vipTime + daysValue) setVipTimeByAccount(acc, time) return TRUE end return FALSEendfunction doRemoveVipDaysByAccount(acc, days) if days > 0 then local daysValue = days * 24 * 60 * 60 local vipTime = getVipTimeByAccount(acc) local time = vipTime - daysValue setVipTimeByAccount(acc, (time <= 0 and 1 or time)) return TRUE end return FALSEendfunction getVipDateByAccount(acc) if isVipAccount(acc) then local vipTime = getVipTimeByAccount(acc) return os.date("%d/%m/%y %X", vipTime) end return FALSEend-- By Playerfunction doTeleportPlayers(cid, topos) doTeleportPlayersByAccount(getPlayerAccountId(cid), topos)endfunction getVipTime(cid) return getVipTimeByAccount(getPlayerAccountId(cid))endfunction setVipTime(cid, time) return setVipTimeByAccount(getPlayerAccountId(cid), time)endfunction getVipDays(cid) return getVipDaysByAccount(getPlayerAccountId(cid))endfunction isVip(cid) return isVipAccount(getPlayerAccountId(cid))endfunction addVipDays(cid, days) return addVipDaysByAccount(getPlayerAccountId(cid), days)endfunction doRemoveVipDays(cid, days) return doRemoveVipDaysByAccount(getPlayerAccountId(cid), days)endfunction getVipDate(cid) return getVipDateByAccount(getPlayerAccountId(cid))end Então acredito que tenha que trocar as storages do seu script por isso "addVipDaysByAccount(acc, days)"
Postado Julho 26, 2013 11 anos sim, teste e vejá se deu certo Ajudei? REP+ http://www.youtube.com/watch?v=xHa6-y2hqrk&feature=youtu.be
Postado Julho 26, 2013 11 anos Autor Eu aqui testando consegui quase o que eu queria, só falta saber se tem como colocar uma storage na conta inteira, e não apenas em um player só, pq se não, da pra fazer a quest em todos chars da mesma conta, e queria que fosse só 1 char da conta conseguisse fazer essa quest entende? Mudei de "setPlayerStorageValue" para "setAccountStorageValue" mas não funciona. /////////// Instalei a function para storage para account e funcionou como eu queria, atraves do topico http://tibiaking.com/forum/topic/21851-function-account-storage/ /////////// Agora só falta conseguir colocar dentro do meu script abaixo, uma mensagem de "cancel" por exemplo: "voce ja pegou os dias vip" acho que não deve ser dificil pra quem entende sobre scripter, sou iniciante ainda... segue abaixo meu script. function onUse(cid, item, frompos, item2, topos) if item.uid == 13540 then -- Aki e o uniqueid que fica no actions.xml sempre mude se for criar outra queststatus = getAccountStorageValue(getPlayerAccountId(cid), 15655) -- Aki Ponhe a mesma storage la de baixo if queststatus == 1 then else doPlayerSendTextMessage(cid,22,"Você recebeu 3 Dias de VIP.") doSendMagicEffect(topos,35) setAccountStorageValue(getPlayerAccountId(cid), 15655, 1) addVipDaysByAccount(getPlayerAccountId(cid), 3) -- Aki e A Storage da vip so mude aki se vo criar outra vip end return 0 end return 1 end Editado Julho 26, 2013 11 anos por Disturbbed (veja o histórico de edições)
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.