Portal SAMP
[Ajuda] Tirar chat global - Versão de Impressão

+- Portal SAMP (https://portalsamp.com)
+-- Fórum: SA-MP (https://portalsamp.com/forumdisplay.php?fid=5)
+--- Fórum: Área de suporte (https://portalsamp.com/forumdisplay.php?fid=6)
+--- Tópico: [Ajuda] Tirar chat global (/showthread.php?tid=649)



Tirar chat global - Alucard - 15/01/2021

Olá! estou tentando remover o chat global de meu servidor, com um código que usei de base, até consegui copilar, porem quando fui testar, o mesmo ainda estava global e gostaria que fosse chat próximo, para servidor rpg/rp. 


Forward: 

Código PHP:
forward ProxDetector(Float:radiplayeridstring[], col1col2col3col4col5);[/font][/size][/color][/b]
public 
ProxDetector(Float:radiplayeridstring[], col1col2col3col4col5)

{

    if(IsPlayerConnected(playerid)) {

        new Float:posxFloat:posyFloat:posz;

        new Float:oldposxFloat:oldposyFloat:oldposz;

        new Float:tempposxFloat:tempposyFloat:tempposz;

        GetPlayerPos(playeridoldposxoldposyoldposz);

        for(new 0MAX_PLAYERSi++) {

            if(IsPlayerConnected(i)) {

                GetPlayerPos(iposxposyposz);

                tempposx = (oldposx -posx);

                tempposy = (oldposy -posy);

                tempposz = (oldposz -posz);

                if (((tempposx radi/16) && (tempposx > -radi/16)) && ((tempposy radi/16) && (tempposy > -radi/16)) && ((tempposz radi/16) && (tempposz > -radi/16))) {

                    SendClientMessage(icol1string);

                }

                else if (((tempposx radi/8) && (tempposx > -radi/8)) && ((tempposy radi/8) && (tempposy > -radi/8)) && ((tempposz radi/8) && (tempposz > -radi/8))) {

                    SendClientMessage(icol2string);

                }

                else if (((tempposx radi/4) && (tempposx > -radi/4)) && ((tempposy radi/4) && (tempposy > -radi/4)) && ((tempposz radi/4) && (tempposz > -radi/4))) {

                    SendClientMessage(icol3string);

                }

                else if (((tempposx radi/2) && (tempposx > -radi/2)) && ((tempposy radi/2) && (tempposy > -radi/2)) && ((tempposz radi/2) && (tempposz > -radi/2))) {

                    SendClientMessage(icol4string);

                }

                else if (((tempposx radi) && (tempposx > -radi)) && ((tempposy radi) && (tempposy > -radi)) && ((tempposz radi) && (tempposz > -radi))) {

                    SendClientMessage(icol5string);

                }

            }

        }

    }

    return 1;
[
color=#000000][size=small][font=Roboto][b]} 

OnPlayerText

Código PHP:
else if(aInfo[playerid][Nivel] == && AdminCamuflado[playerid] == false)
{

format(cstringsizeof(cstring), "%s{FFFFFF}: {FFFFFF}[{8B5742}Estagiário{FFFFFF}] [{%s}%s{FFFFFF}] [%d] %s"GetName(playeridtrue), bInfo[TagBase[playerid]][CorTagBase], bInfo[TagBase[playerid]][SiglaBase], playeridtext);
ProxDetector(30.0,playeridcstringGetPlayerColor(playerid), GetPlayerColor(playerid), GetPlayerColor(playerid), GetPlayerColor(playerid), GetPlayerColor(playerid));
}


Grato a quem ajudar!


RE: Tirar chat global - xbruno1000x - 15/01/2021

Na onplayertext
Código:
MensagemLocal(playerid, GetPlayerColor(playerid), string, 20);
Stock
Código:
MensagemLocal(playerid, cor, text[], distancia)
{
    foreach(new i : Player)
        if(GetDistanceBetweenPlayers(playerid, i) <= distancia)
            if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
                SendClientMessage(i, cor, text);

    return 1;
}