Ir para conteúdo
  • Cadastre-se

Normal [Ajuda] Talkaction /clean não limpa pz


Posts Recomendados

function onSay(player, words, param)
	if not player:getGroup():getAccess() then
		return true
	end

	if player:getAccountType() < ACCOUNT_TYPE_GOD then
		return false
	end

	local itemCount = cleanMap()
	if itemCount > 0 then
		player:sendTextMessage(MESSAGE_STATUS_WARNING, "Cleaned " .. itemCount .. " item" .. (itemCount > 1 and "s" or "") .. " from the map.")
	end
	return false
end

O titulo do topico ja diz tudo, vocês podem conferir meu script de /clean

Link para o post
Compartilhar em outros sites

Isso tem que alterar nas sources em map.cpp

 

uint32_t Map::clean()
{
   uint64_t start = OTSYS_TIME();
   uint32_t count = 0, tiles = 0;
 
   if (g_game.getGameState() == GAME_STATE_NORMAL) {
     g_game.setGameState(GAME_STATE_MAINTAIN);
   }
 
   for (int32_t z = 0; z < (int32_t)MAP_MAX_LAYERS; z++) {
     for (uint32_t y = 1; y <= mapHeight; y++) {
       for (uint32_t x = 1; x <= mapWidth; x++) {
         Tile* tile = getTile(x, y, z);
         if (!tile || tile->hasFlag(TILESTATE_HOUSE) || !tile->getItemList()) {
           continue;
         }
 
         ++tiles;
         TileItemVector* itemList = tile->getItemList();
         ItemVector::iterator it = itemList->begin(), end = itemList->end();
         while (it != end) {
           if ((*it)->isCleanable()) {
             g_game.internalRemoveItem(*it, -1);
             it = itemList->begin();
             end = itemList->end();
             ++count;
           } else {
             ++it;
           }
         }
       }
     }
   }
 
   if (g_game.getGameState() == GAME_STATE_MAINTAIN) {
     g_game.setGameState(GAME_STATE_NORMAL);
   }
 
   std::cout << "> CLEAN: Removed " << count << " item" << (count != 1 ? "s" : "")
    << " from " << tiles << " tile" << (tiles != 1 ? "s" : "") << " in "
    << (OTSYS_TIME() - start) / (1000.) << " seconds." << std::endl;
   return count;
}
 

 

 

Link para o post
Compartilhar em outros sites
7 horas atrás, PsyMcKenzie disse:

Isso tem que alterar nas sources em map.cpp

 


uint32_t Map::clean()
{
   uint64_t start = OTSYS_TIME();
   uint32_t count = 0, tiles = 0;
 
   if (g_game.getGameState() == GAME_STATE_NORMAL) {
     g_game.setGameState(GAME_STATE_MAINTAIN);
   }
 
   for (int32_t z = 0; z < (int32_t)MAP_MAX_LAYERS; z++) {
     for (uint32_t y = 1; y <= mapHeight; y++) {
       for (uint32_t x = 1; x <= mapWidth; x++) {
         Tile* tile = getTile(x, y, z);
         if (!tile || tile->hasFlag(TILESTATE_HOUSE) || !tile->getItemList()) {
           continue;
         }
 
         ++tiles;
         TileItemVector* itemList = tile->getItemList();
         ItemVector::iterator it = itemList->begin(), end = itemList->end();
         while (it != end) {
           if ((*it)->isCleanable()) {
             g_game.internalRemoveItem(*it, -1);
             it = itemList->begin();
             end = itemList->end();
             ++count;
           } else {
             ++it;
           }
         }
       }
     }
   }
 
   if (g_game.getGameState() == GAME_STATE_MAINTAIN) {
     g_game.setGameState(GAME_STATE_NORMAL);
   }
 
   std::cout << "> CLEAN: Removed " << count << " item" << (count != 1 ? "s" : "")
    << " from " << tiles << " tile" << (tiles != 1 ? "s" : "") << " in "
    << (OTSYS_TIME() - start) / (1000.) << " seconds." << std::endl;
   return count;
}
 

 

 

 

eu fiz isso mas dava erro na hora compilar, existe algum outro jeito?

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:
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo