Portal SAMP
[Ajuda] esconder chat android - Versão de Impressão

+- Portal SAMP (https://portalsamp.com)
+-- Fórum: SA-MP Mobile (https://portalsamp.com/forumdisplay.php?fid=11)
+--- Fórum: Área de suporte (https://portalsamp.com/forumdisplay.php?fid=12)
+--- Tópico: [Ajuda] esconder chat android (/showthread.php?tid=2827)



esconder chat android - spongebob - 22/09/2022

eu sei que nao tem essa funçao entao eu tava tentando assim mais não funciona sera que tem como ? o que ta errado?

Código PHP:
#include <a_samp>
#include <zcmd>

new chatOff[MAX_PLAYERS];
new 
IDI;

public 
OnPlayerConnect(playerid)
{
    
chatOff[playerid] = 1;
    return 
1;
}

public 
OnPlayerDisconnect(playeridreason)
{
    
chatOff[playerid] = 1;
    return 
1;
}

public 
OnPlayerText(playeridtext[])
{
    if(
chatOff[IDI] == 0)
    {
    for(new 
i10i++) { SendClientMessage(IDI, -1""); }
    
SendClientMessage(IDI,-1"[INFO] Chat Limpo !");
    }

    return 
1;
}

CMD:coff(playeridparams[])
{
chatOff[playerid] = 0;
SendClientMessage(playerid,-1"[INFO] Chat off ");
return 
1;
}

CMD:con(playeridparams[])
{
chatOff[playerid] = 1;
SendClientMessage(playerid,-1"[INFO] Chat on ");
return 
1;




RE: esconder chat android - Dr Editor - 22/09/2022

Seria mais ou menos isso.

Código:
#include <a_samp>
#include <zcmd>
#include <foreach>

new bool:chatOff[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    chatOff[playerid] = true;
    return 1;
}

public OnPlayerText(playerid, text[])
{
    foreach(new i : Player)
    {
        if(!chatOff[i])
            continue;
        
        SendClientMessage(i, -1, text);
    }
    return 0;
}

CMD:chat(playerid, params[])
{
    chatOff[playerid] = !chatOff[playerid];
    
    new string[40];
    format(string, sizeof string, "[INFO] Chat %s", chatOff[playerid] ? ("ativado") : ("desativado"));
    SendClientMessage(playerid,-1, string);
    return 1;
}



RE: esconder chat android - spongebob - 22/09/2022

(22/09/2022 16:59)Dr Editor Escreveu: Seria mais ou menos isso.

Código:
#include <a_samp>
#include <zcmd>
#include <foreach>

new bool:chatOff[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    chatOff[playerid] = true;
    return 1;
}

public OnPlayerText(playerid, text[])
{
    foreach(new i : Player)
    {
        if(!chatOff[i])
            continue;
        
        SendClientMessage(i, -1, text);
    }
    return 0;
}

CMD:chat(playerid, params[])
{
    chatOff[playerid] = !chatOff[playerid];
    
    new string[40];
    format(string, sizeof string, "[INFO] Chat %s", chatOff[playerid] ? ("ativado") : ("desativado"));
    SendClientMessage(playerid,-1, string);
    return 1;
}

 perfeito vlw mn .