Ir para conteúdo
  • Cadastre-se

Anti Clone System [GlobalEvents] Shop.lua[Gesior] / CheckItens.lua


Posts Recomendados

  Em 12/01/2019 em 04:06, Yan Liima disse:

 

 

Mostrar mais  

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

Meu Servidor Minecraft : Ip - Skylowcraft.minecraftbr.net:25585 = Servidor 24hrs Sem Lag , Sem Hackers (1.7.2) Servidor De Fullpvp e Survival - Vamos Colocar Minigames!.

Link para o post
Compartilhar em outros sites
  • Respostas 16
  • Created
  • Última resposta

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Em GlobalEvents crie um Arquivo chamado Check.lua  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

Se possivel passa seu Gesior que eu faço a adaptação

  Em 12/01/2019 em 08:09, 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

 

Mostrar mais  

Tente assim:

SELECT * , SUBSTRING( CONVERT( attributes
USING latin1 ) 
FROM 18 ) AS 'serial'
FROM player_items
WHERE CONVERT( attributes
USING latin1 ) LIKE '%serial%'

 

════ҳ̸Ҳ̸ҳஜ۩۞۩ஜҳ̸Ҳ̸ҳ═══╗

Te Ajudei? Rep + e ficamos Quits

166420979_logoyanliimaornight.png.33f822b8970081a5b3646e85dbfd5934.png

Precisando de ajuda?

discord.png.1ecd188791d0141f74d99db371a2e0a4.png.890d5a38d7bcde75543c72b624a65de1.pngDiscord: Yan Liima #3702

Programador Júnior de LUA, PHP e JavaScript

Juntos somos lendas, separados somos Mitos!

╚══════════════════════════ҳ̸Ҳ̸ҳஜ۩۞۩ஜҳ̸Ҳ̸ҳ═════════════════════════════╝

Link para o post
Compartilhar em outros sites
  Em 12/01/2019 em 11: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%'

 

 

Mostrar mais  

Pegou, você sabe me dizer porque no meu players_items só aparece o atributo ? não aparece o serial

Meu Servidor Minecraft : Ip - Skylowcraft.minecraftbr.net:25585 = Servidor 24hrs Sem Lag , Sem Hackers (1.7.2) Servidor De Fullpvp e Survival - Vamos Colocar Minigames!.

Link para o post
Compartilhar em outros sites
  • 4 years later...
  Em 12/01/2019 em 11: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%'

 

Expand   Mostrar mais  

 

 

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

 

Link para o post
Compartilhar em outros sites
  • 2 months later...

 

 

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!

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Estatísticas dos Fóruns

    96842
    Tópicos
    519598
    Posts



×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo