Ir para conteúdo

Problema Com Site


TTW2

Posts Recomendados

Galera, preciso de uma ajuda urgente,

eu crio um char no meu gesior, ocorre tudo bem,

seleciono o char e tal, mais ai não loga, no server fala ki logou e deslogou

 

Olha: http://img707.imageshack.us/img707/9278/asdyasdj.jpg

 

meu vipcheck.lua:

 

local config = {

RookSistem = "no",

RookTempleID = 1,

MainTempleID = 2

}

 

config.RookSistem = getBooleanFromString(config.RookSistem)

 

function getResetTemple(cid)

local Query = db.getResult("SELECT `reset_temple` FROM `players` WHERE `players`.`id` = ".. getPlayerGUID(cid) ..";")

return (isPlayer(cid) == true and (Query:getDataInt("reset_temple") == 1)) and true or false

end

 

function goRookTemple(cid)

doTeleportThing(cid, getTownTemplePosition(config.RookTempleID))

doSendMagicEffect(fromPos, CONST_ME_POFF)

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)

db.executeQuery("UPDATE `players` SET `reset_temple` = 0 WHERE `players`.`id` = ".. getPlayerGUID(cid) ..";")

end

 

function goMainTemple(cid)

doTeleportThing(cid, getTownTemplePosition(config.MainTempleID))

doPlayerSetTown(cid, config.MainTempleID)

doSendMagicEffect(fromPos, CONST_ME_POFF)

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)

db.executeQuery("UPDATE `players` SET `reset_temple` = 0 WHERE `players`.`id` = ".. getPlayerGUID(cid) ..";")

end

 

function onLogin(cid)

fromPos = getCreaturePosition(cid)

if getResetTemple(cid) == true then

if (config.RookSistem) then

if isRookie(cid) == true then

goRookTemple(cid)

else

goMainTemple(cid)

end

else

goMainTemple(cid)

end

end

return true

end

 

Meu 004-database.lua:

 

 

if(result == nil) then

print("> WARNING: Couldn't load database lib.")

return

end

 

Result = createClass(nil)

Result:setAttributes({

id = -1,

query = ""

})

 

function Result:getID()

return self.id

end

 

function Result:setID(_id)

self.id = _id

end

 

function Result:getQuery()

return self.query

end

 

function Result:setQuery(_query)

self.query = _query

end

 

function Result:create(_query)

self:setQuery(_query)

local _id = db.storeQuery(self:getQuery())

if(_id) then

self:setID(_id)

end

 

return self:getID()

end

 

function Result:getRows(free)

local free = free or false

if(self:getID() == -1) then

error("[Result:getRows] Result not set!")

end

 

local c = 0

repeat

c = c + 1

until not self:next()

 

local _query = self:getQuery()

self:free()

if(not free) then

self:create(_query)

end

 

return c

end

 

function Result:getDataInt(s)

if(self:getID() == -1) then

error("[Result:getDataInt] Result not set!")

end

 

return result.getDataInt(self:getID(), s)

end

 

function Result:getDataLong(s)

if(self:getID() == -1) then

error("[Result:getDataLong] Result not set!")

end

 

return result.getDataLong(self:getID(), s)

end

 

function Result:getDataString(s)

if(self:getID() == -1) then

error("[Result:getDataString] Result not set!")

end

 

return result.getDataString(self:getID(), s)

end

 

function Result:getDataStream(s)

if(self:getID() == -1) then

error("[Result:getDataStream] Result not set!")

end

 

return result.getDataStream(self:getID(), s)

end

 

function Result:next()

if(self:getID() == -1) then

error("[Result:next] Result not set!")

end

 

return result.next(self:getID())

end

 

function Result:free()

if(self:getID() == -1) then

error("[Result:free] Result not set!")

end

 

self:setQuery("")

local ret = result.free(self:getID())

self:setID(-1)

return ret

end

 

Result.numRows = Result.getRows

function db.getResult(query)

if(type(query) ~= 'string') then

return nil

end

 

local ret = Result:new()

ret:create(query)

return ret

end

 

Quem puder me ajudar, obrigado desde já!

Link para o comentário
Compartilhar em outros sites

  • Quem Está Navegando   0 membros estão online

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