Ir para conteúdo

leo420

Membro
  • Registro em

  • Última visita

  1. leo420 respondeu ao post em um tópico de leo420 em Suporte Tibia OTServer
    Keke, até por isso criei o tópico este script eu tenho guardado a muito tempo não lembro o site dele =/ no banco de dados adicionei assim: ALTER TABLE `players` ADD `creditos` INT NOT NULL DEFAULT '0'
  2. leo420 respondeu ao post em um tópico de leo420 em Suporte Tibia OTServer
    la lib/function adicionei assim ó: function getCreditos(cid) local check = db.getResult("SELECT `creditos` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. " LIMIT 1") return check:getDataInt("creditos") <= 0 and 0 or check:getDataInt("creditos") end function addCreditos(cid,amount) db.executeQuery("UPDATE `players` SET `creditos` = "..getCreditos(cid).."+"..amount.." WHERE `id` = "..getPlayerGUID(cid)) end function removeCreditos(cid,amount) db.executeQuery("UPDATE `players` SET `creditos` = "..getCreditos(cid).."-"..amount.." WHERE `id` = "..getPlayerGUID(cid)) end function setCreditos(cid,value) db.executeQuery("UPDATE `players` SET `creditos` = "..value.." WHERE `id` = "..getPlayerGUID(cid)) end
  3. leo420 postou uma resposta no tópico em Suporte Tibia OTServer
    Salve galera, to com um ot online e utilizava um sistema de shop in-game, agora eu mudei o distro tento adicionar os créditos pro player, não ganha os créditos e da erro no distro com a mensagem: ERRO: [Error - TalkAction Interface ] data/talkactions/scripts/systempoints.lua:onSay Description data/lib/050-function.lua:31: attempt to call field `executeQuery` <a nil value> stack traceback: data/lib/050-function.lua:31: in function `addCreditos` data/talkactions/scripts/systempoints.lua:24: in function <data/ talkactions/scripts/systempoints.lua:1> SCRIPT: function onSay(cid, words, param) if(words == "!creditos") then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce Possui "..getCreditos(cid).." Creditos.") elseif(words == "!rankcreditos") then local max_players,str = 20,"" str = "--[ RANK CREDITOS ]--\n\n" query = db.getResult("SELECT `name`, `creditos` FROM `players` WHERE `creditos` > -1 AND `id` > 6 AND `group_id` < 2 ORDER BY `creditos` DESC, `name` ASC;") if (query:getID() ~= -1) then k = 1 while true do str = str .. "\n " .. k .. ". " .. query:getDataString("name") .. " - [" .. query:getDataInt("creditos") .. "]" k = k + 1 if not(query:next()) or k > max_players then break end end query:free()end if str ~= "" then doShowTextDialog(cid,6500, str) end elseif(words == "/addcreditos") then if getPlayerAccess(cid) == 5 then local t = string.explode(param, ",") if not t[1] or not t[2] then return TRUE,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") end local player = getPlayerByName(t[1]) local creditos = t[2] local pid = getPlayerByNameWildcard(t[1]) if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then return TRUE,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "você adicionou "..creditos.." Creditos do jogador "..t[1]) doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Foram adicionados "..creditos.." Creditos no seu character.") addCreditos(player,creditos) doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Você agora tem "..getCreditos(player).." Creditos.") end elseif(words == "/delcreditos") then if getPlayerAccess(cid) == 5 then local t = string.explode(param, ",") if not t[1] or not t[2] then return TRUE,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") end local player = getPlayerByName(t[1]) local creditos = t[2] local pid = getPlayerByNameWildcard(t[1]) if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then return TRUE,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "você removeu "..creditos.." Creditos do jogador "..t[1]) doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Foram removidos "..creditos.." Creditos do seu character.") removeCreditos(player,creditos) doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Você agora tem "..getCreditos(player).." Creditos.") end elseif(words == "/setcreditos") then if getPlayerAccess(cid) == 5 then local t = string.explode(param, ",") if not t[1] or not t[2] then return TRUE,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") end local player = getPlayerByName(t[1]) local creditos = t[2] local pid = getPlayerByNameWildcard(t[1]) if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then return TRUE,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Agora o jogador "..t[1].." tem "..creditos.." Creditos no seu character.") doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "agora você tem "..creditos.." Creditos do seu character.") setCreditos(player,creditos) end end return TRUE end alguém sabe oque pode ser, alguma função que tem que adicionar?
  4. leo420 postou uma resposta no tópico em Suporte Tibia OTServer
    Olá galera, Seguinte, to com o projeto de montar um ot, porém estou usando o DISTRO do otserv (PBOT), pois la tem o sistema do mesmo item com atributos diferentes, o server ta no mode: sqlType = "sqlite" sqlHost = "localhost" sqlPort = 3306 sqlUser = "root" sqlPass = "" sqlDatabase = "thunderbr" sqlFile = "thunderbr.s3db" sqlKeepAlive = 0 mysqlReadTimeout = 0 mysqlWriteTimeout = 0 encryptionType = "sha1" Quando eu logo no acc manager beleza, porém quando eu crio uma acc, o primeiro char você tenta logar o acc manager pela account da ( PASS INCORRETO ), tentei alterar de SHA1 p/ plain não da nem pra logar nos chars, fala que as senhas ta tudo errada =/ alguém tem alguma solução, sem trocar o distro ? :X
  5. Galera to com um script aqui que quero muito usar no meu ot, porém ele tem um pequeno bug que nao sei concerta-lo, ve se voces podem me ajudar: 1 - To usando um sistema de refinamento que uma pedra id 8302(Jewel of Bless) aumenta até +6 de atributos nos items, atk def arm, e uma pedra id 8303(Jewel of Soul) que aumenta até +10..porém quando usada a pedra em escudo ele aumenta defesa e (atk), queria que ele só acrescenta defesa, porque shield com atk nao da certo '-'.. 2 - No mesmo script de refinamento, quando usado muito as jewels manda a seguinte mensagem no console: [10/10/2012 00:10:54] [Error - Action Interface] [10/10/2012 00:10:54] data/actions/scripts/refine.lua:onUse [10/10/2012 00:10:54] Description: [10/10/2012 00:10:54] data/lib/RefineSystem.lua:76: attempt to compare number with boolean [10/10/2012 00:10:54] stack traceback: [10/10/2012 00:10:54] data/lib/RefineSystem.lua:76: in function 'isEquipment' [10/10/2012 00:10:54] data/lib/RefineSystem.lua:127: in function 'load' [10/10/2012 00:10:54] data/actions/scripts/refine.lua:2: in function <data/actions/scripts/refine.lua:1> Script ( Pasta Lib ): Action: <action itemid="8302;8303" event="script" value="refine.lua"/>

Informação Importante

Confirmação de Termo