[Ajuda] Desativar o Chat
#1

Ajuda

Bom Estou com um Comando muito Util ( Creditos: [NWD]Jim._.Carrey )

Mas Nao esta funcionando da Meneira Correta ...

Desativa o Chat mas Mesmo Assim um player normal consegue escrever no chat, a unica coisa que Faz й quando um player escrever algo aparece na tela dele assim "[x] O Chat foi Desativado por Um Administrador"

pawn Код:
enum pInfo
{
    Chat,
}


public OnPlayerConnect(playerid)
{
    PlayerInfo[playerid][Chat] = 0;
}

public OnPlayerDisconnect(playerid, reason)
{
    PlayerInfo[playerid][Chat] = 0;
}

// OnPlayerText Completo, Pois Acho que o Erro encontra-se aqui
public OnPlayerText(playerid, text[])  
{
    if(PlayerInfo[playerid][Chat] == 1 && PlayerInfo[playerid][pAdmin] <= 1000)
    {
    SendClientMessage(playerid, VERMELHO_ESCURO, "[x]  O chat foi desativado por um Administrador!");
    }
    new StringTexto[228];

    GetPlayerName(playerid, pNome, sizeof(pNome));
    for(new i; i != GetMaxPlayers(); i++)
    {
        if(PlayerInfo[playerid][pAdmin] == 2000)
        {
            format(StringTexto, sizeof(StringTexto), "® %s [%d]: {FFFFFF}%s", pNome, playerid, text);
            SendClientMessage(i, GetPlayerColor(playerid), StringTexto);
        }
        else if(PlayerInfo[playerid][pAdmin] == 1000)
        {
            format(StringTexto, sizeof(StringTexto), "© %s [%d]: {FFFFFF}%s ", pNome, playerid, text);
            SendClientMessage(i, GetPlayerColor(playerid), StringTexto);
        }
        if(PlayerInfo[playerid][pAdmin] == 0)
        {
            format(StringTexto, sizeof(StringTexto), "• %s [%d]: {FFFFFF}%s", pNome, playerid, text);
            SendClientMessage(i, GetPlayerColor(playerid), StringTexto);
        }
    }
    AdminColor(playerid);

    return 0;
}


// CMD DO CHAT

CMD:chaton(playerid, params[])
{
    new TextoChat[256], name[MAX_PLAYER_NAME];
    if(PlayerInfo[playerid][pAdmin] < 1000)
    {
        SendClientMessage(playerid, VERMELHO_ESCURO,"[x] Vocк Nao Tem Permissao!");
        return 1;
    }
    if(PlayerInfo[playerid][pAdmin] > 2000)
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
            GetPlayerName(playerid, name, sizeof(name));
            format(TextoChat, sizeof(TextoChat), "[ BCV ] O Administrador %s Ativou o Chat.", name);
            SendClientMessageToAll(0x00FF40AA, TextoChat);
            PlayerInfo[i][Chat] = 0;
            }
        }
    }
    return 1;
}

CMD:chatoff(playerid, params[])
{
    new TextoChat[256], name[MAX_PLAYER_NAME];
    if(PlayerInfo[playerid][pAdmin] < 2000)
    {
        SendClientMessage(playerid, VERMELHO_ESCURO,"[x] Vocк Nao Tem Permissao!");
        return 1;
    }
    if(PlayerInfo[playerid][pAdmin] >= 2000)
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
            GetPlayerName(playerid, name, sizeof(name));
            format(TextoChat, sizeof(TextoChat), "[ BCV ] O Administrador %s Desativou o Chat.", name);
            SendClientMessageToAll(VERMELHO_ESCURO, TextoChat);
            PlayerInfo[i][Chat] = 1;
            }
        }
    }
    return 1;
}
Reply
#2

pawn Код:
// Topo do GM
new bool:Bloqueado;



// COMANDO PARA BLOEUEAR
Bloqueado = true;

// Comando para desbloquear
Bloqueado = false;


// public OnPlayerText
if(Bloqueado) return false;
Reply
#3

Oi Obrigado por Ajudar mas Nao Funcionou ...

Mais Alguem ?
Reply
#4

pawn Код:
new BloquearChat[MAX_PLAYERS];

public OnPlayerText(playerid, text[])
{
      if(BloquearChat[playerid] == 1)
      {
             SendClientMessage(playerid, -1, "Chat Bloqueado, Vocк nгo Pode Digitar.");
             return 0;
      }
      return 1;
}

CMD:bloquearchat(playerid)
{
     for(new i = 0; i < MAX_PLAYERS; i++)
     {
           BloquearChat[i] = 1;
     }
     return 1;
}

CMD:desbloquearchat(playerid)
{
     for(new d = 0; d < MAX_PLAYERS; d++)
     {
           BloquearChat[d] = 0;
     }
     return 1;
}
Isso Bloquearб/Desbloquearб o chat Para Todos.
Reply
#5

+ REP

FUNCIONOU SEM NENHUM BUG =D
Reply
#6

Quote:
Originally Posted by .FuneraL.
Посмотреть сообщение
pawn Код:
new BloquearChat[MAX_PLAYERS];

public OnPlayerText(playerid, text[])
{
      if(BloquearChat[playerid] == 1)
      {
             SendClientMessage(playerid, -1, "Chat Bloqueado, Vocк nгo Pode Digitar.");
             return 0;
      }
      return 1;
}

CMD:bloquearchat(playerid)
{
     for(new i = 0; i < MAX_PLAYERS; i++)
     {
           BloquearChat[i] = 1;
     }
     return 1;
}

CMD:desbloquearchat(playerid)
{
     for(new d = 0; d < MAX_PLAYERS; d++)
     {
           BloquearChat[d] = 0;
     }
     return 1;
}
Isso Bloquearб/Desbloquearб o chat Para Todos.
pawn Код:
new BloquearChat[MAX_PLAYERS];

public OnPlayerText(playerid, text[])
{
    if(BloquearChat[playerid] == 1) return SendClientMessage(playerid, -1, "Chat Bloqueado, Vocк nгo Pode Digitar.");
    return 1;
}

CMD:bloquearchat(playerid)
{
    for(new i = 0; i < MAX_PLAYERS; i++){BloquearChat[i] = 1;}
    return 1;
}

CMD:desbloquearchat(playerid)
{
    for(new d = 0; d < MAX_PLAYERS; d++){BloquearChat[d] = 0;}
    return 1;
}
Nгo seria mais facil economizar linhas?
Reply
#7

Quote:
Originally Posted by dPlaYer_
Посмотреть сообщение
pawn Код:
new BloquearChat[MAX_PLAYERS];

public OnPlayerText(playerid, text[])
{
    if(BloquearChat[playerid] == 1) return SendClientMessage(playerid, -1, "Chat Bloqueado, Vocк nгo Pode Digitar.");
    return 1;
}

CMD:bloquearchat(playerid)
{
    for(new i = 0; i < MAX_PLAYERS; i++){BloquearChat[i] = 1;}
    return 1;
}

CMD:desbloquearchat(playerid)
{
    for(new d = 0; d < MAX_PLAYERS; d++){BloquearChat[d] = 0;}
    return 1;
}
Nгo seria mais facil economizar linhas?
Verdade dPlaYer_ , existe este detalhe, mas como fiz rapidamente, nem lembrei de fazer isto kk
Reply
#8

Ok Da Mesma Forma Obrigado os Dois =D
Reply


Forum Jump:


Users browsing this thread: