Você tem que executar a query para criar a coluna points na tabela players
ALTER TABLE `players` ADD `points` INT NOT NULL DEFAULT 0;
Você tem que executar a query para criar a coluna points na tabela players
ALTER TABLE `players` ADD `points` INT NOT NULL DEFAULT 0;
info
Grupo: Campones
Registrado: 20/01/12
Posts: 69
Reputação: +1
Gênero: Masculino
Char no Tibia: Piiratta

Eu executei.. tudo certinho...
fiz tudo como esta no Tópico...
Tanto, que nem da erro quando carrega...
só quando vai utilizar no caso...
e esta dando isso ;s
Não, meu velho, você não executou. Pois o erro simplesmente é sobre a não-existência da coluna points.
info
Grupo: Campones
Registrado: 20/01/12
Posts: 69
Reputação: +1
Gênero: Masculino
Char no Tibia: Piiratta

Acho que descobri +/- o problema..
Eu executei.. Porém não coloquei o " ; "
Seria por isso?
Esses ; sempre dando trabalho...
Obrigado
Não, cara, não tem nada a ver. Tanto faz com ponto-e-vírgula ou sem. Você simplesmente está achando que executou a query, mas não executou nada ou executou na database errada.
info
Grupo: Campones
Registrado: 20/01/12
Posts: 69
Reputação: +1
Gênero: Masculino
Char no Tibia: Piiratta

Sim, consegui arrumar agora! ![]()
Se alguem pudesse modificar esse Script aqui, pra entregar os Points também, se o Player estiver Offline! eu ficaria muito grato!
no /addpoints
Script:
function onSay(cid, words, param)
if(words == "!points") then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você tem "..getPoints(cid).." Points.")
elseif(words == "!rankpoints") then
local max_players,str = 20,""
str = "--[ RANK POINTS ]--\n\n"
query = db.getResult("SELECT `name`, `points` FROM `players` WHERE `points` > -1 AND `id` > 6 AND `group_id` < 2 ORDER BY `points` DESC, `name` ASC;")
if (query:getID() ~= -1) then k = 1 while true do
str = str .. "\n " .. k .. ". " .. query:getDataString("name") .. " - [" .. query:getDataInt("points") .. "]"
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 == "/addpoints") 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 points = 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 "..points.." Points do jogador "..t[1])
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Foram adicionados "..points.." Points no seu character.")
addPoints(player,points)
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Você agora tem "..getPoints(player).." Points.")
end
elseif(words == "/delpoints") 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 points = 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 "..points.." Points do jogador "..t[1])
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Foram removidos "..points.." Points do seu character.")
removePoints(player,points)
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Você agora tem "..getPoints(player).." Points.")
end
elseif(words == "/setpoints") 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 points = 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 "..points.." Points no seu character.")
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "agora você tem "..points.." Points do seu character.")
setPoints(player,points)
end
end
return TRUE
end
Meu Deus... não sei contar quantas vezes me perdi nesse código macarrônico aí.
function onSay(cid, words, param)
if(words == "!points") then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você tem "..getPoints(cid).." Points.")
elseif(words == "!rankpoints") then
local max_players,str = 20,""
str = "--[ RANK POINTS ]--\n\n"
query = db.getResult("SELECT `name`, `points` FROM `players` WHERE `points` > -1 AND `id` > 6 AND `group_id` < 2 ORDER BY `points` DESC, `name` ASC;")
if (query:getID() ~= -1) then k = 1 while true do
str = str .. "\n " .. k .. ". " .. query:getDataString("name") .. " - [" .. query:getDataInt("points") .. "]"
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 == "/addpoints") 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 points = tonumber(t[2]) or 1
local pid = getPlayerByNameWildcard(t[1])
if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
db.executeQuery("UPDATE players SET `points` = `points` + ".. points .." WHERE `name` = ".. db.escapeString(t[1]) ..";")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "você adicionou "..points.." Points do jogador "..t[1])
return true
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "você adicionou "..points.." Points do jogador "..t[1])
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Foram adicionados "..points.." Points no seu character.")
addPoints(player,points)
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Você agora tem "..getPoints(player).." Points.")
end
elseif(words == "/delpoints") 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 points = tonumber(t[2]) or 1
local pid = getPlayerByNameWildcard(t[1])
if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
db.executeQuery("UPDATE players SET `points` = `points` - ".. points .." WHERE `name` = ".. db.escapeString(t[1]) ..";")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "você removeu "..points.." Points do jogador "..t[1])
return true
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "você removeu "..points.." Points do jogador "..t[1])
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Foram removidos "..points.." Points do seu character.")
removePoints(player,points)
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Você agora tem "..getPoints(player).." Points.")
end
elseif(words == "/setpoints") 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 points = 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 "..points.." Points no seu character.")
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "agora você tem "..points.." Points do seu character.")
setPoints(player,points)
end
end
return TRUE
end
info
Grupo: Campones
Registrado: 20/01/12
Posts: 69
Reputação: +1
Gênero: Masculino
Char no Tibia: Piiratta

Muito boom!
Perfeiito! REP ++
Só faltou se o Player não existir... ;s
![]()
Desculpe, mas se o dono do tópico reportou como funcional, o problema de não estar adicionando pontos deve ser aí, jNNo.
Enfim, estou movendo o tópico para Pedidos e dúvidas resolvidos - Scripting
info
Grupo: Campones
Registrado: 20/01/12
Posts: 69
Reputação: +1
Gênero: Masculino
Char no Tibia: Piiratta

Muito boom!
Perfeiito! REP ++
Só faltou se o Player não existir... ;s
Aprende a testar os script cara, não adiciona os points não, só manda a mensagem!
Pela mor de Deus, Oneshot pode fazer outro?
Aprender a Testar?
Aprende a instalar certo então --'
Porque aqui funcionou perfeitamente!
info
Grupo: Campones
Registrado: 20/01/12
Posts: 69
Reputação: +1
Gênero: Masculino
Char no Tibia: Piiratta
Olá galera...
Estou com um problema nesse sisteminha de Shopping por pontos do Vodkart que encontrei nesse Tópico..
http://www.xtibia.co...__fromsearch__1
Bom, instalei tudo corretamente, porem quando clico no báu para comprar ele da o erro:
Error during getDataInt<points>.
E quando tento adicionar uma quantidade de pontos a um player, da um erro,
tirei até a print.
Se alguém puder me ajudar...
Estou precisando muito ..
Obrigado.
-----
@Edit
Problema resolvido.
Editado Janeiro 4 por piratadoidao