Postado Março 13, 2019 6 anos Entao Pessoal To Com poblema Com Esse Script Ele ta Funcionando Mais Quando Ponho / addpoints (FULANO), 100 Aparece a Message ( Foram Adicionado 100 Points ) mas quando do !points aparece que tenho 0 e no console da a seguinte mensagem Está surgindo algum erro? Se sim coloque-o aqui. Citar [16:37:25.152] Error during getDataInt(points). [16:37:28.507] OTSYS_SQLITE3_PREPARE(): SQLITE ERROR: no such column: points (UPDATE "players" SET "points" = 30 WHERE "id" = 3) Você tem o código disponível? Se tiver publique-o aqui: 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, "voce 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, "Voce 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 ja tenho a tabela points adicionada ESSES 100 EU ADICIONAI MANUALMENTE PELO CONSOLE! Editado Março 13, 2019 6 anos por gabrielwinter09 (veja o histórico de edições)
Postado Março 13, 2019 6 anos na sua database vc executa: ALTER TABLE `players` ADD `points` INT NOT NULL DEFAULT '0' [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Março 13, 2019 6 anos Autor 1 hora atrás, Vodkart disse: na sua database vc executa: ALTER TABLE `players` ADD `points` INT NOT NULL DEFAULT '0' executei, jaja eu coloco a db no server, e esse erro aqui tenho que criar a coluna war e tabela killers?? OTSYS_SQLITE3_PREPARE(): SQLITE ERROR: table killers has no column named war (INSERT INTO "killers" ("death_id", "final_hit", "unjustified", "war") VALUES (1, 1, 0, 0))
Postado Março 14, 2019 6 anos está dizendo que na coluna "killers" não tem nada do parâmetro "war" [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
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.