function getGuildNameById(id)
local Info = db.getResult("SELECT `name` FROM `guilds` WHERE `id` = " .. id .. ";")
if Info:getID() ~= LUA_ERROR then
local Name= Info:getDataString("name")
Info:free()
return Name
end
return LUA_ERROR
end
info
Grupo: Conde
Registrado: 29/04/09
Posts: 904
Reputação: +389
Char no Tibia: Jabuti Selvagem

function getGuildNameById(id)
local Info = db.getResult("SELECT `name` FROM `guilds` WHERE `id` = " .. id .. ";")
if Info:getID() ~= LUA_ERROR then
local Name= Info:getDataString("name")
Info:free()
return Name
end
return LUA_ERROR
end
function getGuildNameById(id) local Info = db.getResult("SELECT `name` FROM `guilds` WHERE `id` = " .. id .. ";") if Info:getID() ~= LUA_ERROR then local Name= Info:getDataString("name") Info:free() return Name end return LUA_ERROR end
Valeu amoeba! Funcionou direitinho.
Da uma olhada nestes topicos, talvez você possa min ajudar.
http://www.xtibia.com/forum/topic/226909-erro-de-compatibilidade-com-o-arquivo-itemsotb/
http://www.xtibia.com/forum/topic/226870-tutorial-criando-mods/
http://www.xtibia.com/forum/topic/226727-ativardesativar-script-de-em-dia-e-horario-especifico/
Editado Janeiro 10 por Mazynho
info
Grupo: Campones
Registrado: 06/11/13
Posts: 99
Reputação: +2
Galera preciso de uma função que retorne o nome da guild pelo id dela.
Tenho uma storage que armazeno o ID da guild então quero uma função que faça uma busca na DB e min retorne o nome.