Postado Janeiro 12, 2019 6 anos 4 horas atrás, Yan Liima disse: Sabe qual error é esse? é na hora de adicionar a query #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 0, 30' at line 6
Postado Janeiro 12, 2019 6 anos 2 horas atrás, Christinacsa disse: Sabe qual error é esse? é na hora de adicionar a query #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 0, 30' at line 6 Tente assim: SELECT * , SUBSTRING( CONVERT( attributes USING latin1 ) FROM 18 ) AS 'serial' FROM player_items WHERE CONVERT( attributes USING latin1 ) LIKE '%serial%'
Postado Janeiro 12, 2019 6 anos 3 horas atrás, Yan Liima disse: Tente assim: SELECT * , SUBSTRING( CONVERT( attributes USING latin1 ) FROM 18 ) AS 'serial' FROM player_items WHERE CONVERT( attributes USING latin1 ) LIKE '%serial%' Pegou, você sabe me dizer porque no meu players_items só aparece o atributo ? não aparece o serial
Postado Fevereiro 26, 2023 2 anos Em 12/01/2019 em 09:08, Yan Liima disse: Tente assim: SELECT * , SUBSTRING( CONVERT( attributes USING latin1 ) FROM 18 ) AS 'serial' FROM player_items WHERE CONVERT( attributes USING latin1 ) LIKE '%serial%' estou com esse error: [1:17:43.155] [Error - GlobalEvent Interface] [1:17:43.157] data/globalevents/scripts/Check.lua:onStartup [1:17:43.160] Description: [1:17:43.161] (luaGetPlayerNameByGUID) Player not found [1:17:43.163] [Error - GlobalEvent Interface] [1:17:43.164] data/globalevents/scripts/Check.lua:onStartup [1:17:43.165] Description: [1:17:43.166] data/globalevents/scripts/Check.lua:9: attempt to concatenate a nil value [1:17:43.167] stack traceback: [1:17:43.168] data/globalevents/scripts/Check.lua:9: in function 'CheckPlayer_Items' [1:17:43.169] data/globalevents/scripts/Check.lua:53: in function <data/globalevents/scripts/Check.lua:52> poderia me ajudar? codigo: local function CheckPlayer_Items() query = db.getResult("SELECT *, SUBSTRING( CONVERT( attributes USING latin1 ) FROM 22) AS 'serial' FROM player_items WHERE CONVERT( attributes USING latin1 ) LIKE '%description%' GROUP BY SUBSTRING( CONVERT( attributes USING latin1 ) FROM 22) having count(*) > 1") if (query:getID() == -1) then textquery = "\n Check Items : Nenhum item encontrado." print(textquery) return true end if (query:getID() ~= -1) then text = "\n[!] -> Deleting item player_items: [Player ID: " .. getPlayerNameByGUID(query:getDataInt("player_id")) .. " - Sid: "..(query:getDataInt("sid")).." - Pid: "..(query:getDataInt("pid")).." - Itemtype: "..(query:getDataInt("itemtype")).." - Serial: " .. query:getDataString("serial") .."" db.query("DELETE FROM `otservs`.`player_items` WHERE `player_items`.`player_id` =" .. (query:getDataInt("player_id")) .. " AND `player_items`.`sid` ="..(query:getDataInt("sid")).." AND `player_items`.`pid` ="..(query:getDataInt("pid"))..";") db.query("DELETE FROM `otservs`.`player_depotitems` WHERE SUBSTRING(CONVERT(attributes USING latin1) FROM 22) = " .. db.escapeString(query:getDataString("serial")) .. ";") db.query("DELETE FROM `otservs`.`tile_items` WHERE SUBSTRING(CONVERT(attributes USING latin1) FROM 22) = " .. db.escapeString(query:getDataString("serial")) .. ";") f = io.open("data/logs/AntiClone.txt", "a+") f:write("Player: "..text.." - " .. os.date("%d %B %Y - %X.", os.time()) .."\n\n----------------------------------------------------------\n") f:close() print(text) if (query:getID() == -1) then textplayer_items = "\n Check Items : Todos os Items Foram Removidos." print(textplayer_items) return true end CheckPlayer_Items() end return true end local function CheckPlayer_DepotItems() query = db.getResult("SELECT *, SUBSTRING( CONVERT( attributes USING latin1 ) FROM 22) AS 'serial' FROM player_depotitems WHERE CONVERT( attributes USING latin1 ) LIKE '%description%' GROUP BY SUBSTRING( CONVERT( attributes USING latin1 ) FROM 22) having count(*) > 1") if (query:getID() == -1) then textquery = "\n Check Items : Nenhum item encontrado." print(textquery) return true end if (query:getID() ~= -1) then text = "\n[!] -> Deleting item player_depotitems: [Player ID: " .. getPlayerNameByGUID(query:getDataInt("player_id")) .. " - Sid: "..(query:getDataInt("sid")).." - Pid: "..(query:getDataInt("pid")).." - Itemtype: "..(query:getDataInt("itemtype")).." - Serial: " .. query:getDataString("serial") .."" db.query("DELETE FROM `otservs`.`player_items` WHERE `player_items`.`player_id` =" .. (query:getDataInt("player_id")) .. " AND `player_items`.`sid` ="..(query:getDataInt("sid")).." AND `player_items`.`pid` ="..(query:getDataInt("pid"))..";") db.query("DELETE FROM `otservs`.`player_depotitems` WHERE SUBSTRING(CONVERT(attributes USING latin1) FROM 22) = " .. db.escapeString(query:getDataString("serial")) .. ";") db.query("DELETE FROM `otservs`.`tile_items` WHERE SUBSTRING(CONVERT(attributes USING latin1) FROM 22) = " .. db.escapeString(query:getDataString("serial")) .. ";") f = io.open("data/logs/AntiClone.txt", "a+") f:write("Player: "..text.." - " .. os.date("%d %B %Y - %X.", os.time()) .."\n\n----------------------------------------------------------\n") f:close() print(text) if (query:getID() == -1) then textplayer_items = "\n Check Items : Todos os Items Foram Removidos." print(textplayer_items) return true end CheckPlayer_DepotItems() end return true end function onStartup() CheckPlayer_Items() CheckPlayer_DepotItems() return true end
Postado Maio 15, 2023 2 anos ERROR CORRIGIDO e codigo atualizaçao pra remover itens especifico do jogador ao inicia o server: local function CheckPlayer_Items() local query = db.getResult("SELECT *, SUBSTRING(CONVERT(attributes USING latin1) FROM 22) AS 'serial' FROM player_items WHERE CONVERT(attributes USING latin1) LIKE '%description%' GROUP BY SUBSTRING(CONVERT(attributes USING latin1) FROM 22) HAVING COUNT(*) > 1") if query:getID() == -1 then local textquery = "\n Check Items: Nenhum item clonado foi encontrado." print(textquery) return true end if query:getID() ~= -1 then local playerName = getPlayerNameByGUID(query:getDataInt("player_id")) if playerName == nil then playerName = "Player Not Found" end local text = "\n[!] -> Deleting item player_items: [Player ID: " .. playerName .. " - Sid: " .. (query:getDataInt("sid")) .. " - Pid: " .. (query:getDataInt("pid")) .. " - Itemtype: " .. (query:getDataInt("itemtype")) .. " - Serial: " .. query:getDataString("serial") .. "]" db.query("DELETE FROM `dbo`.`player_items` WHERE `player_items`.`player_id` = " .. (query:getDataInt("player_id")) .. " AND `player_items`.`sid` = " .. (query:getDataInt("sid")) .. " AND `player_items`.`pid` = " .. (query:getDataInt("pid")) .. ";") db.query("DELETE FROM `dbo`.`player_depotitems` WHERE SUBSTRING(CONVERT(attributes USING latin1) FROM 22) = " .. db.escapeString(query:getDataString("serial")) .. ";") db.query("DELETE FROM `dbo`.`tile_items` WHERE SUBSTRING(CONVERT(attributes USING latin1) FROM 22) = " .. db.escapeString(query:getDataString("serial")) .. ";") local f = io.open("data/logs/AntiClone.txt", "a+") f:write("Player: " .. text .. " - " .. os.date("%d %B %Y - %X.", os.time()) .. "\n\n----------------------------------------------------------\n") f:close() print(text) if query:getID() == -1 then local textplayer_items = "\n Check Items: Todos os Items Foram Removidos." print(textplayer_items) return true end CheckPlayer_Items() end return true end local function CheckPlayer_DepotItems() local query = db.getResult("SELECT *, SUBSTRING(CONVERT(attributes USING latin1) FROM 22) AS 'serial' FROM player_depotitems WHERE CONVERT(attributes USING latin1) LIKE '%description%' GROUP BY SUBSTRING(CONVERT(attributes USING latin1) FROM 22) HAVING COUNT(*) > 1") if query:getID() == -1 then local textquery = "\n Check Items: Nenhum item clonado foi encontrado." print(textquery) return true end if query:getID() ~= -1 then local text = "\n[!] -> Deleting item player_depotitems: [Player ID: " .. getPlayerNameByGUID(query:getDataInt("player_id")) .. " - Sid: " .. (query:getDataInt("sid")) .. " - Pid: " .. (query:getDataInt("pid")) .. " - Itemtype: " .. (query:getDataInt("itemtype")) .. " - Serial: " .. query:getDataString("serial") .. "]" db.query("DELETE FROM `dbo`.`player_items` WHERE `player_items`.`player_id` = " .. (query:getDataInt("player_id")) .. " AND `player_items`.`sid` = " .. (query:getDataInt("sid")) .. " AND `player_items`.`pid` = " .. (query:getDataInt("pid")) .. ";") db.query("DELETE FROM `dbo`.`player_items` WHERE `player_items`.`player_id` = " .. (query:getDataInt("player_id")) .. " AND `player_items`.`sid` = " .. (query:getDataInt("sid")) .. " AND `player_items`.`pid` = " .. (query:getDataInt("pid")) .. ";") db.query("DELETE FROM `dbo`.`player_depotitems` WHERE SUBSTRING(CONVERT(attributes USING latin1) FROM 22) = " .. db.escapeString(query:getDataString("serial")) .. ";") db.query("DELETE FROM `dbo`.`tile_items` WHERE SUBSTRING(CONVERT(attributes USING latin1) FROM 22) = " .. db.escapeString(query:getDataString("serial")) .. ";") local f = io.open("data/logs/AntiClone.txt", "a+") f:write("Player: " .. text .. " - " .. os.date("%d %B %Y - %X.", os.time()) .. "\n\n----------------------------------------------------------\n") f:close() print(text) if query:getID() == -1 then local textplayer_items = "\n Check Items: Todos os Items Foram Removidos." print(textplayer_items) return true end CheckPlayer_DepotItems() end return true end function onStartup() CheckPlayer_Items() CheckPlayer_DepotItems() return true end local function RemoveItemsFromPlayers(itemIDs) for _, itemID in ipairs(itemIDs) do local query = db.getResult("SELECT DISTINCT player_id FROM player_items WHERE itemtype = " .. itemID) if query:getID() == -1 then print("\n[!] -> Check Items: Nenhum jogador possui o item com ID " .. itemID .. ".") else local playerFound = false while query:next() do local playerId = query:getDataInt("player_id") local playerName = getPlayerNameByGUID(playerId) if playerName == nil then playerName = "Player Not Found" end local text = "\n[!] -> Deleting item from player: [Player ID: " .. playerName .. " - Item ID: " .. itemID .. "]" db.query("DELETE FROM `dbo`.`player_items` WHERE `player_id` = " .. playerId .. " AND `itemtype` = " .. itemID .. ";") local f = io.open("data/logs/ItemRemoval.txt", "a+") f:write("Player: " .. text .. " - " .. os.date("%d %B %Y - %X.", os.time()) .. "\n\n----------------------------------------------------------\n") f:close() print(text) playerFound = true end if not playerFound then print("\n[!] -> Check Items: Nenhum jogador possui o item com ID " .. itemID .. ".") end end end return true end function onStartup() -- lista de IDs de itens que você deseja remover de todos os jogadores local itemsToRemove = {15579, 15007, 10552, 15288} -- Substitua pelos IDs dos itens que você deseja remover RemoveItemsFromPlayers(itemsToRemove) CheckPlayer_Items() CheckPlayer_DepotItems() return true end global events: <globalevent name="AntiClone" type="start" event="script" value="Check.lua"/> Va ate a pasta data/logs/ e crie um arquivo em txt com o nome "AntiClone" qualquer duvida fico a disposição!
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.