Ir para conteúdo

Vodkart

Herói
  • Total de itens

    3406
  • Registro em

  • Última visita

  • Dias Ganhos

    113

Tudo que Vodkart postou

  1. você pode usar o seguinte: function getContainerSlotsFree(container) -- by vodka return getContainerCap(container)-getContainerSize(container) end vai retornar quantos slots tem sobrando no contêiner
  2. Vodkart

    Depotaccount

    eu não entendi nada rapaz, é só para ver os items que tem dentro daquela box?
  3. function onLogin(cid) local t = {16, "10.1.1.3"} if getPlayerAccountId(cid) == t[1] and doConvertIntegerToIp(getPlayerIp(cid)) ~= t[2] then return false end return true end local t = {16, "10.1.1.3"} 16 é o ID da account e "10.1.1.3" é o IP
  4. +ou- isso function onStatsChange(cid, attacker, type, combat, value) local damageMin = (getPlayerLevel(cid) * 2) local damageMax = (getPlayerLevel(cid) * 3) if type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS then if getPlayerStorageValue(cid, 23194) == 1 then doTargetCombatHealth(cid, attacker, COMBAT_HOLYDAMAGE, -damageMin, -damageMax, CONST_ME_HOLYDAMAGE) end return true end return true end
  5. Não sei... mas tenta algo do tipo: trocar essa parte: return db.executeQuery("UPDATE `accounts` SET `key` = '"..newrk.."' WHERE `id` = "..getPlayerAccountId(cid)) and newrk or false por return db.executeQuery("UPDATE `accounts` SET `key` = sha1(`newrk`) WHERE `id` = "..getPlayerAccountId(cid)) and newrk or false ou return db.executeQuery("UPDATE `accounts` SET `key` = sha1('"..newrk.."') WHERE `id` = "..getPlayerAccountId(cid)) and newrk or false
  6. sim, arrumei a função agora, porque 0 mostrava senhas de quem não tinha KEY rsrs nome do seu script.lua function setPlayerRecoveryKey(cid) local wd,newrk = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789","" for i = 0, 15 do tmp = math.random(1,#wd) newrk = newrk..string.sub(wd,tmp,tmp) end local newrk = string.gsub(newrk, "(....)", "%1-", 3) local keyexists = db.getResult("SELECT * FROM `accounts` WHERE `key` = '"..newrk.."'") if (keyexists:getID() ~= -1) then return setPlayerRecoveryKey(cid) end return db.executeQuery("UPDATE `accounts` SET `key` = '"..newrk.."' WHERE `id` = "..getPlayerAccountId(cid)) and newrk or false end function getPlayerKey(n) -- by vodka local qry,str = db.getResult("SELECT `name`,`password` FROM `accounts` WHERE `key` > 0 AND `key` = "..db.escapeString(n)),"" if (qry:getID() ~= -1) then str = "Account: "..qry:getDataString("name").."\nSenha: "..qry:getDataString("password") end return str end function onSay(cid, words, param) if (words == "/setkey") then local newKey = setPlayerRecoveryKey(cid) if newKey then doPlayerPopupFYI(cid,"Parabéns, você recebeu uma Key! anote os seguintes digitos:\n\nKey: "..newKey) return true end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[Error] Não foi possível gerar uma Key, tente novamente!.") elseif (words == "/getkey") then local param = string.upper(param) if getPlayerKey(tostring(param)) == "" then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"está key não existe") return true end doPlayerPopupFYI(cid,"Account Info:\n\n\n"..getPlayerKey(tostring(param))) end return true end talkactions.xml <talkaction words="/setkey;/getkey" event="script" value="nome do seu script.lua"/>
  7. Vodkart

    Shop Points

    só trocar nas frases onde tem "points" por "créditos"
  8. function setPlayerRecoveryKey(cid) local wd,newrk = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789","" for i = 0, 15 do tmp = math.random(1,#wd) newrk = newrk..string.sub(wd,tmp,tmp) end local newrk = string.gsub(newrk, "(....)", "%1-", 3) local keyexists = db.getResult("SELECT * FROM `accounts` WHERE `key` = '"..newrk.."'") if (keyexists:getID() ~= -1) then return setPlayerRecoveryKey(cid) end return db.executeQuery("UPDATE `accounts` SET `key` = '"..newrk.."' WHERE `id` = "..getPlayerAccountId(cid)) and newrk or false end function getPlayerKey(n) -- by vodka local qry,str = db.getResult("SELECT `name`,`password` FROM `accounts` WHERE `key` > 0 AND `key` = "..db.escapeString(n)),"" if (qry:getID() ~= -1) then str = "Account: "..qry:getDataString("name").."\nSenha: "..qry:getDataString("password") end return str end essa função "setPlayerRecoveryKey(cid)" Gera a key com números e letras, ficando assim: LHW5-FFLT-MCUN-2K32 ai para recuperar a account vc faria assim a talk function onSay(cid, words, param) local param = string.upper(param) if getPlayerKey(tostring(param)) == "" then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"está key não existe") end return doPlayerPopupFYI(cid,"Account Info:\n\n\n"..getPlayerKey(tostring(param))) end !comando "KEY exemplo: !comando lhw5-fflt-mcun-2k32
  9. mas claro, alguém mexeu no sscript. qndo o jogador morre a sua storage não é removida. Vou deixar a solução aqui para você e em seguida remova o script porque não autorizei ninguém a postar, esse script eu tinha feito para um outro usuário que ficou de terminar, eu refiz esse código. em data/creaturescript/script/login.lua antes do último return true adc: local event_storages = {156231,156232,156233,156234} for _, i in pairs(event_storages) do setPlayerStorageValue(cid, i, -1) end
  10. então só usar 'onStatsChange' velho rs
  11. Vodkart

    Shop Points

    tag <talkaction words="!pointshop;/pointshop" script="shopoint.lua" /> você usa assim: !pointshop -- retorna quantos créditos vc tem !pointshop lista -- retorna a lista de items a venda !pointshop NOME DO ITEM exemplo: !pointshop nightmare doll desculpe, mas você precisa de 90 points para comprar o nightmare doll
  12. já tentou usar a função onAttack(cid, target) ?
  13. Função só para retornar "o" ou "os" maiores números de uma tabela TableHighValue = function(n) table.sort(n, function(x, y) return x > y end) return n end exemplo de uso local tabble = {10,12,40,100,7,50,200} print(TableHighValue(tabble)[1]) retorna -> 200 que é o maior número da tabela ou local tabble = {10,12,40,100,7,50,200} for i = 1,#TableHighValue(tabble) do print(TableHighValue(tabble)[i]) end retorna todos os números da tabela em forma descrecente: 200 100 50 40 12 10 7 abraços
  14. Vodkart

    Shop Points

    seria isso amigo? function onSay(cid, words, param) local t = { ["nightmare doll"] = {item ={117,1},points = 90}, ["sd"] = {item ={2268,100},points = 10} } local param,str = string.lower(param),"" if param == "" then doPlayerSendTextMessage(cid, 27, "Voce possui "..getPoints(cid).." creditos.") return true elseif param == 'lista' then for name, x in pairs(t) do str = str.."\nItem: "..name.." -> Price: [" ..x.points.."]" end doShowTextDialog(cid, 2529, str) return true end local buy = t[param] if not(buy) then doPlayerSendTextMessage(cid, 22, "desculpe, mas este não existe, digite !comando lista") return true elseif getPoints(cid) < buy.points then doPlayerSendTextMessage(cid, 22, "desculpe, mas você precisa de "..buy.points.." points para comprar o "..param) return true end doPlayerAddItem(cid, buy.item[1],buy.item[2]) removePoints(cid,buy.points) doPlayerSendTextMessage(cid, 27, "Parabéns! você comprou "..buy.item[2].." ".. getItemNameById(buy.item[1]) ..".") return true end local t = { ["nightmare doll"] = {item ={117,1},points = 90}, ["sd"] = {item ={2268,100},points = 10} } ["nome do item"] = item = {ID DO ITEM, QUANTIDADE} points = QUANTOS PONTO IRÁ CUSTAR
  15. http://www.xtibia.com/forum/topic/191478-reset-que-ganha-vocation/
  16. Parabéns velho!! REP+ agora faz uma função que retorne os maiores números de uma tabela, exemplo: local t = {15,87,90,1} retornar: 1 -> 90 2 -> 87 3 -> 15 4 -> 1
  17. mas amigo esse script que está dando erro deve ser o MODS que você está usando, remove ele.
  18. me manda o script que você está usando então,
  19. o novo código que eu postei não pede não
  20. nome do seu script.lua function onOutfit(cid, old, current) local from,to = {x=586, y=29, z=7},{x=703, y=55, z=7} return not isInRange(getCreaturePosition(cid), from, to) and true or false end creaturescript.xml <event type="outfit" name="NotOut" event="script" value="nome do seu script.lua"/> em creaturescript/script/login.lua antes do último return true adc registerCreatureEvent(cid, "NotOut")
  21. então usa assim function onTimer() function doBroadSave(delay) if delay ~= 0 then doBroadcastMessage("[Global server save] O server será desligado em "..delay.." Minuto"..(delay > 1 and "s" or "")) addEvent(doBroadSave, 60000, delay -1) else doSaveServer() doShutdown() end end doBroadSave(5) return true end <globalevent name="globalSave" time="17:00" event="script" value="globalSave.lua"/>
  22. ele já salva quando da shutdown? ou tem que dar save + shutdown?
  23. o seu serve é em mile segundos?
  24. closecleansave.lua local config = { times = {"04:55","16:55"}, minutes = 5 } function CloseAndSave() if doSetGameState(GAMESTATE_CLOSED) then doSaveServer(false) addEvent(doSetGameState, 5000, GAMESTATE_NORMAL) end end function doBroadSave(delay) if delay ~= 0 then doBroadcastMessage("[Global server save] O server será desligado em "..delay.." Minuto"..(delay > 1 and "s" or "")) addEvent(doBroadSave, 60000, delay -1) end end function onThink(interval, lastExecution) if isInArray(config.times, tostring(os.date("%X")):sub(1, 5)) then doBroadSave(config.minutes) addEvent(CloseAndSave, config.minutes*60*1000) end return true end globalevebts.xml <globalevent name="CloseAndSave" interval="60" event="script" value="closecleansave.lua"/>
  25. tipo ele começa a avisar 04:55 as 05:00 ele fecha e salva e abre que hrs? as 05:05?
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...