Ir para conteúdo
Entre para seguir isso  
MatheusEnjoy

GM Muted

Recommended Posts

MatheusEnjoy    9
MatheusEnjoy

arhPioO.png

Nome: GM Muted
Versão: 1.0
Código
Jackson Zani, Valker(Code)
Forum Origem: RIP XTibia
Descrição: GM não aparece na lista e não recebe PM.

 
Bom vamos ao tutorial:
 
Em game.cpp procure a função Game::playerSpeakTo e abaixo de :
 

Player* toPlayer = getPlayerByName(receiver);
if(!toPlayer) {
     player->sendTextMessage(MSG_STATUS_SMALL, "A player with this name is not online.");
     return false;
}

Adicione:

#ifdef __BB_ANTI_MSG__
if(toPlayer->getAccessLevel() >= GM_PM_LEV && GM_PM == "no" && player->getAccessLevel() < ACCESS_TALK) {         std::stringstream ww;
         ww << "You cannot message to " << toPlayer->getName() << ".";
         player->sendTextMessage(MSG_STATUS_SMALL, ww.str());
        return false;
    }
    #endif

Em configmanager.cpp abaixo de:
 

m_confInteger[ACCESS_LOOK] = getGlobalNumber(L, "accesslook", 1);
Adicione:

#ifdef __BB_ANTI_MSG__
m_confString[GM_PM] = getGlobalString(L, "gm_pm", "no");
m_confInteger[GM_PM_LEV] = getGlobalNumber(L, "gm_block_pm_lev", 3);
#endif

Em configmanager.h abaixo de:
 

MAX_DEPOT_ITEMS,

Adicione:
 

#ifdef __BB_ANTI_MSG__
    GM_PM_LEV,
    #endif

ainda em configmanager.h abaixo de:
 

BATTLE_WINDOW_PLAYERS,

Adicione:
 

#ifdef __BB_ANTI_MSG__
     GM_PM,
#endif

Em definitions.h abaixo de:
 

#define ACCESS_LOOK g_config.getNumber(ConfigManager::ACCESS_LOOK)

Adicione:
 

#ifdef __BB_ANTI_MSG__
#define GM_PM g_config.getString(ConfigManager::GM_PM)
#define GM_PM_LEV g_config.getNumber(ConfigManager::GM_PM_LEV)
#endif

no config.lua adicione:
 

-- do you want to player can message to GM?(yes/no)
gm_pm = "no"

-- access level to block message from players
gm_block_pm_lev = 3

agora dê alt+p vá em paramenters e em C++

Adicione:

-D__BB_ANTI_MSG__

Compartilhar este post


Link para o post
grilo13    60
grilo13

Seria uma boa se ele não recebesse mensagens apenas enquanto está em modo Ghost. Igual a função de aparecer na lista, em /ghost não aparece, fora do /ghost aparece

Compartilhar este post


Link para o post
Visitante
Este tópico está impedido de receber novos posts.
Entre para seguir isso  
  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×