Jump to content

Bloquear Chat Em Mapas


tierrilopes
 Share

Recommended Posts

Serve para bloquear o chat em certos mapas.

Utilizarei o mapa ox (id 113) como exemplo:

 

Ir até ao ficheiro game/src/input_main.cpp

 

Procurar por:

 

 

 

int CInputMain::Chat(LPCHARACTER ch, const char * data, size_t uiBytes)

{

const TPacketCGChat* pinfo = reinterpret_cast<const TPacketCGChat*>(data);

 

if (uiBytes < pinfo->size)

return -1;

 

const int iExtraLen = pinfo->size - sizeof(TPacketCGChat);

 

 

 

if (iExtraLen < 0)

{

sys_err("invalid packet length (len %d size %u buffer %u)", iExtraLen, pinfo->size, uiBytes);

ch->GetDesc()->SetPhase(PHASE_CLOSE);

return -1;

}

 

 

 

 

Adicionar isto debaixo:

 

 

 

if (ch->GetMapIndex() == 113)

{

ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Chat desativado neste mapa."));

return iExtraLen;

}

 

 

 

 

 

Onde está ch->GetMapIndex() == 113 substituir o 113 pelo id do mapa a bloquear o chat.

 

Clipboardimage2016-05-01153203.png

Link to comment
Share on other sites

  • 2 months later...

Alternativa e bloquear chat num certo mapa, excepto para uma personagem:

 

Ao invés de adicionar por baixo o conteúdo do primeiro tópico, adicionar o seguinte:

 

std::string nNome = ch->GetName();

if (ch->GetMapIndex() == 113 && nNome != "tierrilopes")

{

ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Chat desativado neste mapa."));

return iExtraLen;

}

 

Onde tierrilopes = nome da personagem

 

Todas as personagens no mapa 113 não conseguiram utilizar o chat, excepto a personagem com o nome tierrilopes.

Link to comment
Share on other sites

  • 7 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...