[Admin] tierrilopes Posted February 22, 2016 Share Posted February 22, 2016 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. Link to comment Share on other sites More sharing options...
Karbust Posted May 1, 2016 Share Posted May 1, 2016 Boas Também funciona com Pm's ou só no chat? Link to comment Share on other sites More sharing options...
Requiem Posted May 1, 2016 Share Posted May 1, 2016 Penso que apenas no chat, mas não tenho a certeza.. Ainda não testei, porém vou começar agora a mexer na source e vou implementar isto.. Depois posso-te dizer, mas só lá para Quarta ou Quinta, pois tenho teste e trabalho amanhã e depois de amanhã, e só terça é que começo a mexer nisso. Link to comment Share on other sites More sharing options...
Karbust Posted May 1, 2016 Share Posted May 1, 2016 Já meti isso, só falta testar... Link to comment Share on other sites More sharing options...
[Admin] tierrilopes Posted May 1, 2016 Author Share Posted May 1, 2016 Corrigido. Só para chat normal Link to comment Share on other sites More sharing options...
Karbust Posted May 1, 2016 Share Posted May 1, 2016 Sabes como meter para PM's também? Link to comment Share on other sites More sharing options...
[Admin] tierrilopes Posted May 1, 2016 Author Share Posted May 1, 2016 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 More sharing options...
Guest Gamers Posted December 6, 2016 Share Posted December 6, 2016 BUG: Bloqueado o chat, bloqueia quando vai selecionar, fechar etc, teria como arrumar isso ? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now