[Ajuda] Chat global
#1

Bom como meu servidor tem chat global, eu queria saber como fazer para que enquanto o player nгo logar ao servidor ou seja se ele estiver no RequestClass ele й impedido de ver o Chat Global, alguйm sabe como fazer isso? Obrigado pela compreensгo.
Reply
#2

pawn Код:
new bool:Spawned[MAX_PLAYERS];

public OnPlayerText(playerid,text[])
{
    for (new x; x < MAX_PLAYERS; x ++) {
        if (Spawned[playerid] == true && IsPlayerConnected(x) && Spawned[x] == true) {
            new name[MAX_PLAYER_NAME],Msg[128];
            GetPlayerName(playerid,name,sizeof(name));
            format(Msg,sizeof(Msg),"%s:%s",name,text);
            SendClientMessage(x,-1,Msg);
        }
    }
    return false; //retornar a falso й realmente muito importante neste caso.
}

public OnPlayerSpawn(playerid)
{
    Spawned[playerid] = true;
    return true;
}
Reply
#3

Strong vou testar aqui, obrigado eu estava atrбs disso fais muito tempo.
Reply
#4

pawn Код:
new bool:ToNoChatGente[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
    ToNoChatGente[playerid] = false;
    return 1;
}
public OnPlayerText(playerid, text[]);
{
    new string[256], pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "%s[%d]: {FFFFFF}%s", pname, playerid, text);
    SendClientMessageToAllEx(GetPlayerColor(playerid), string);
    return 0;
}
public OnPlayerSpawn(playerid)
{
    if(ToNoChatGente[playerid] == false)
    {
        ToNoChatGente[playerid] = true;
    }
    return 1;
}
stock SendClientMessageToAllEx(color, const message[])
{
    for(new i = 0; i <= MAX_PLAYERS; i++)
    {
        if(ToNoChatGente[i] == true && IsPlayerConnected(i))
        {
            SendClientMessage(i, color, message);
        }
    }
    return 1;
}
Reply
#5

o tуpico jб foi respondido nгo teve a necessidade nenhuma de vocк postar este cуdigo que no final das contas da na mesma meu caro.
Reply
#6

Strong eu usei seu code, tinha um errinho mais eu arrumei, mбs mesmo assim muito obrigado mesmo.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)