Ir para conteúdo

Featured Replies

  • Respostas 10
  • Visualizações 926
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Posted Images

Postado

no tfs 0.4 eu uso assim:

 


bool Game::playerSay(uint32_t playerId, uint16_t channelId, SpeakClasses type, const std::string& receiver, const std::string& text, ProtocolGame* pg)
{
    Player* player = getPlayerByID(playerId);
    if(!player || player->isRemoved())
        return false;

    if (pg != NULL && pg->getIsCast() && !player->isAccountManager())
    {
        if(player->hasCondition(CONDITION_EXHAUST, 64597))
            return false;

        if(Condition* conditionchannel = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_EXHAUST, 2000, 0, false, 64597))
            player->addCondition(conditionchannel);

        if(g_talkActions->onPlayerSay(player, type == SPEAK_SAY ? (unsigned)CHANNEL_DEFAULT : channelId, text, false, pg))
            return true;

        PlayerCast pc = player->getCast();
        for(std::list<CastBan>::iterator it = pc.muted.begin(); it != pc.muted.end(); ++it)
            if(it->ip == pg->getIP())
            {
                pg->publicSendMessage(player, SPEAK_PRIVATE, "You are muted on this cast.");
                return false;
            }

        if(playerTalkToChannel(player, type, text, channelId, pg))
            return true;
        else
            return false;
    }

    uint32_t muted = 0;
    bool mute = player->isMuted(channelId, type, muted);
    if(muted && mute)
    {
        char buffer[75];
        sprintf(buffer, "You are still muted for %d seconds.", muted);
        player->sendTextMessage(MSG_STATUS_SMALL, buffer);
        return false;
    }

 

..........

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo