Ir para conteúdo
  • Cadastre-se

Normal Shop guild não envia o item


Posts Recomendados

Larissa, tá dando esse error aqui vc pode me ajuda com isso ? obrigado mais uma vez rs'  :wow:  :D

 

guildpoints

 

 

 GuildPointsConfigs =

{
   ExecuteIntervalHours = 24,
   NeedPlayersOnline = 10,
   NeedDiferentIps = 10,
   MinLevel = 150,
   AddPointsForAcc = 20
}
 
 
function getGuildPlayersValidAccIDS(GuildID, MinLevel)
   local RanksIDS, AccsID, ValidAccsID = {}, {}, {}
   local q = db.storeQuery("SELECT `id` FROM `guild_ranks` WHERE guild_id = '".. GuildID .."';")
 
   if q then
      return ValidAccsID
   end
 
   while true do
 table.insert(RanksIDS, result.getDataInt(q, "id"))
 
 if not result.next(q) then
break
end
   end
 
   local q = db.storeQuery("SELECT `account_id` FROM `players` WHERE `rank_id` IN (".. table.concat(RanksIDS, ', ') ..") AND `level` >= ".. MinLevel ..";")
   if q then
      return ValidAccsID
   end
 
   while true do
      local AccID = result.getDataInt(q, "account_id")
      if #AccsID > 0 then
         for k = 1, #AccsID do
            if AccID == AccsID[k] then
               AddAccList = false
               break
            end
            AddAccList = true
         end
         if AddAccList then
            table.insert(AccsID, AccID)
         end
      else
         table.insert(AccsID, AccID)
      end
 
 if not result.next(q) then
break
end
   end
 
   local q = db.storeQuery("SELECT `id` FROM `accounts` WHERE `guild_points_stats` = 0 AND `id` IN (".. table.concat(AccsID, ', ') ..");")
 
   if q then
      return ValidAccsID
   end
 
   while true do
      local AccID = result.getDataInt(q, "id")
 
      if #ValidAccsID > 0 then
         for k = 1, #ValidAccsID do
            if AccID == ValidAccsID[k] then
               AddAccList = false
               break
            end
            AddAccList = true
         end
         if AddAccList then
            table.insert(ValidAccsID, AccID)
         end
      else
         table.insert(ValidAccsID, AccID)
      end
 
 if not result.next(q) then
break
      end
   end
 
   return ValidAccsID
end
 
 
function onSay(cid, words, param, channel)
   if(getPlayerGuildLevel(cid) == 3) then
      local GuildID = getPlayerGuildId(cid)
      local q = db.storeQuery("SELECT `last_execute_points` FROM `guilds` WHERE id = '".. GuildID .."';")
 
      if not q then
return true
      end
 
      if result.getDataInt(q, "last_execute_points") < os.time() then
         local GuildMembers = {}
         local GuildMembersOnline = {}
         local PlayersOnline = getPlayersOnline()
 
for i, pid in ipairs(PlayersOnline) do
            if getPlayerGuildId(pid) == GuildID then
               if getPlayerLevel(pid) >= GuildPointsConfigs.MinLevel then
                  table.insert(GuildMembersOnline, pid)
               end
            end
         end
 
         if #GuildMembersOnline >= GuildPointsConfigs.NeedPlayersOnline then
            local IPS = {}
            for i, pid in ipairs(GuildMembersOnline) do
               local PlayerIP = getPlayerIp(pid)
               if #IPS > 0 then
                  for k = 1, #IPS do
                     if PlayerIP == IPS[k] then
                        AddIPList = false
                        break
                     end
                     AddIPList = true
                  end
                  if AddIPList then
                     table.insert(IPS, PlayerIP)
                  end
               else
                  table.insert(IPS, PlayerIP)
               end
            end
            if #IPS >= GuildPointsConfigs.NeedDiferentIps then
               local ValidAccounts = getGuildPlayersValidAccIDS(GuildID, GuildPointsConfigs.MinLevel)
 
  db.query("UPDATE `guilds` SET `last_execute_points` = ".. os.time() +(GuildPointsConfigs.ExecuteIntervalHours * 3600) .." WHERE `guilds`.`id` = ".. GuildID ..";")
 
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "".. #ValidAccounts .." Players received points")
 
  if #ValidAccounts > 0 then
 
 db.query("UPDATE `accounts` SET `guild_points` = `guild_points` + " ..GuildPointsConfigs.AddPointsForAcc .. ", `guild_points_stats` = ".. os.time() .." WHERE `id` IN (" .. table.concat(ValidAccounts, ',') ..");")
 
                  for i, pid in ipairs(GuildMembersOnline) do
                     local PlayerMSGAccID = getPlayerAccountId(pid)
                     for k = 1, #ValidAccounts do
                        if PlayerMSGAccID == ValidAccounts[k] then
                           doPlayerSendTextMessage(pid, MESSAGE_INFO_DESCR, "You received "..GuildPointsConfigs.AddPointsForAcc .." guild points.")
                           break
                        end
                     end
                  end
               end
            else
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Only ".. #IPS .." players are valid, you need ".. GuildPointsConfigs.NeedDiferentIps .." players with different ips.")
            end
         else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Has only ".. #GuildMembersOnline .." players online you need ".. GuildPointsConfigs.NeedPlayersOnline .." players online at least from level ".. GuildPointsConfigs.MinLevel ..".")
         end
      else
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "The command can only be run once every "..GuildPointsConfigs.ExecuteIntervalHours .." hours.")
      end
   else
      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Only guild leader can request points.")
   end
   return true

end 

 

11908240_839535749496112_1863755646_n.jp

Link para o post
Compartilhar em outros sites
  • 1 month later...
  • Respostas 11
  • Created
  • Última resposta

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

mano se tu tem copia meu script e coloca no lugar do velho. "porque seu script ta com defeito"

Tente: -- ### CONFIG ### -- message send to player by script "type" (types you can check in "global.lua") SHOP_MSG_TYPE = 19 -- time (in seconds) between connections to SQL database by shop script SQL_interval = 30 -- ### END OF CONFIG ### function onThink(interval, lastExecution) local result_plr = db.getResult("SELECT * FROM z_ots_comunication WHERE `type` = 'login';") if(result_plr:getID() ~= -1) then while(true) do id = tonumber(result_plr:getDataInt("id")) action = tostring(result_plr:get

Nossa, agora que vi que confundi o adrianinho com o ADM WAR. Veja se resolve seu problema: http://www.tibiaking.com/forum/topic/32919-tfs-10-guildpoints-system-talkactions/

Meu guild shop está tudo tranquilo, o único problema é que não envia o item ao player, e na database z_shopguild_history_item está la a linha que o player comprou um item mas ta com status "wait" alguma solução????

 

Não há erros na distro

nbeTETb.png?1

 

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.

  • Conteúdo Similar

    • Por Jaurez
      .
    • Por Cat
      Em alguns casos, o tibia 8.60 comum não abre de jeito nenhum no map editor, mesmo desmarcando check file signatures e configurando o path corretamente.
       
      Este é o client 8.60 adaptado para o Remere's Map Editor. Resolvi postar já que ele foi removido do site oficial do RME. (ficou apenas a versão para linux lá)
      Se estiver tendo problemas para abrir a versão 8.60, tente utilizar este.
                                                                                                                     
      Baixar o Tibia Client 8.60 que funciona no Remere’s Map Editor
      Essa versão do Tibia 8.60 client resolve o erro unsupported client version ou Could not locate tibia.dat and/or tibia.spr, please navigate to your tibia 8.60 installation folder.
       
      Downloads
      https://tibiaking.com/applications/core/interface/file/attachment.php?id=47333

      Scan: https://www.virustotal.com/gui/file/333e172ac49ba2028db9eb5889994509e7d2de28ebccfa428c04e86defbe15cc
       
    • Por danilo belato
      Fala Galera To Com um problema aki 
       
      quero exporta umas sprites de um server para colocar em outro 
       
      eu clico na sprites ai aparece tds a forma delas do lado de la >>
       
      ai eu clico nela e ponho a opiçao de export mais quando salvo a sprite ela n abri 
       
      aparece isso quando tento vê-la 
       
      visualização não disponível ( no formatos png e bitmap)
       
      Agora no formato idc fala que o paint n pode ler 
       
      me ajudem ae...
    • Por Vitor Bicaleto
      Galera to com o script do addon doll aqui, quando eu digito apenas "!addon" ele aparece assim: Digite novamente, algo está errado!"
      quando digito por exemplo: "!addon citizen" ele não funciona e não da nenhum erro
       
      mesma coisa acontece com o mount doll.. 
    • Por Ayron5
      Substitui uma stone no serve, deu tudo certo fora  esse  erro ajudem  Valendo  Rep+  Grato  

      Erro: data/actions/scripts/boost.lua:557: table index is nil
       [Warning - Event::loadScript] Cannot load script (data/actions/scripts/boost.lua)

      Script:
  • Estatísticas dos Fóruns

    96841
    Tópicos
    519578
    Posts



×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo