Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado
function getPlayerPoints (cid)
local res = db.getResult('select `points` from players where name = \''..getPlayerAccount(cid)..'\'')
if(res:getID() == 1) then
return false
end
local ret = res:getDataInt("points")
res:free()
return tonumber (ret)
end

function doPlayerAddPoints(cid, count)
return db.executeQuery("UPDATE `players` SET points = '"..getPlayerPoints(cid) + count .."' WHERE `name` ='"..getPlayerAccount(cid).."'")
end

 

Editado por movie (veja o histórico de edições)

  • Respostas 34
  • Visualizações 2.8k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • local ponto = 11395 -- n mude local storage = 15412 -- mude para outro function onUse(cid, item) if getPlayerStorageValue(cid, storage) >= 0 then return doPlayerBroadcastMessage(cid, "Voce ja r

  • @Rayo Tem algumas sessões no fórum que utiliza uns tutoriais, dá uma pesquisada. Tem um grupo no Discord focado em programação OT Server - Lua, aonde tem uma gama de materiais lá.  @ZikaLord Olá, col

  • function getPlayerPoints (cid) local res = db.getResult('select `points` from players where name = '..getCreatureName(cid)..'') if(res:getID() == 1) then return false end local ret = res:getDataInt("p

Posted Images

Postado
  • Autor
8 minutos atrás, movie disse:

function getPlayerPoints (cid)
local res = db.getResult('select `points` from players where name = \''..getPlayerAccount(cid)..'\'')
if(res:getID() == 1) then
return false
end
local ret = res:getDataInt("points")
res:free()
return tonumber (ret)
end

function doPlayerAddPoints(cid, count)
return db.executeQuery("UPDATE `players` SET points = '"..getPlayerPoints(cid) + count .."' WHERE `name` ='"..getPlayerAccount(cid).."'")
end

 

Nao Funciono Deu Erro

 

 

[22:11:02.971] [Error - Action Interface]
[22:11:02.978] data/actions/scripts/Peterson/pointscroll.lua:onUse
[22:11:02.984] Description:
[22:11:02.986] data/lib/004-database.lua:66: [Result:getDataInt] Result not set!

[22:11:02.995] stack traceback:
[22:11:03.001]  [C]: in function 'error'
[22:11:03.004]  data/lib/004-database.lua:66: in function 'getDataInt'
[22:11:03.010]  data/lib/048-ppoints.lua:6: in function 'getPlayerPoints'
[22:11:03.021]  data/lib/048-ppoints.lua:12: in function 'doPlayerAddPoints'
[22:11:03.027]  data/actions/scripts/Peterson/pointscroll.lua:8: in function <da
ta/actions/scripts/Peterson/pointscroll.lua:5>

Postado
function getPlayerPoints (cid)
local res = db.getResult('select `points` from players where name = \''..getCreatureName(cid)..'\'')
if(res:getID() == 1) then
return false
end
local ret = res:getDataInt("points")
res:free()
return tonumber (ret)
end

function doPlayerAddPoints(cid, count)
return db.executeQuery("UPDATE `players` SET points = '"..getPlayerPoints(cid) + count .."' WHERE `name` ='"..getCreatureName(cid).."'")
end

 

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo