SA-MP Forums Archive
[Ajuda] Chat proximo - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Chat proximo (/showthread.php?tid=454438)



Chat proximo - ThiagoMK - 28.07.2013

Galera meu chat proximo funciona normal quando nгo tem ninguem por perto quando chega alguem nгo aparece a mensagem nem pra mim nem para a pessoa alguem pode ajudar

pawn Код:
if(text[0] == ';')
{
   
    PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
    for(new i; i != MAX_PLAYERS; i++)
    {
       
        new Float:p[3];
        GetPlayerPos(i,p[0],p[1],p[2]);
        if(IsPlayerInRangeOfPoint(playerid,15.0,p[0],p[1],p[2]))
        {
           
            new Float:MSG[3];
            if(MSG[i] == 0)
            {
               
                new sStr[256];
                new Name[24];
                GetPlayerName(playerid,Name,24);
                format(sStr,128,"(Chat Prox){FF0000}%s (%i): {00FFFF}%s",Name,playerid,text[1]);
                SendClientMessage(i,-1,sStr);
                PlayerPlaySound(i,1057,0.0,0.0,0.0);
                MSG[i] = 1;
            }
            MSG[i] = 0;
            return 0;
        }
    }
}



Re: Chat proximo - Gii - 28.07.2013

pawn Код:
if(text[0] == ';') {

    new Float:p[3],sStr[128],Name[21];

    GetPlayerName(playerid,Name,21);
    GetPlayerPos(playerid,p[0],p[1],p[2]);
    PlayerPlaySound(playerid,1057,0.0,0.0,0.0);

    for(new i; i != MAX_PLAYERS; i++) {

        if(IsPlayerInRangeOfPoint(i, 15.0,p[0],p[1],p[2])) {

            new Float:MSG[3];
           
            if(MSG[i] == 0) {

                format(sStr,128,"(Chat Prox){FF0000}%s (%i): {00FFFF}%s",Name,playerid,text[1]);
                SendClientMessage(i,-1,sStr);
                PlayerPlaySound(i,1057,0.0,0.0,0.0);
                MSG[i] = 1;
            }
            MSG[i] = 0;
            return 0;
        }
    }
}
Nгo era mais fбcil usar https://sampwiki.blast.hk/wiki/LimitGlobalChatRadius ?


Re: Chat proximo - darkxdll - 28.07.2013

iCasTiel , ele quer para quando digitar assim :

; oi

com o ";" antes da mensagem



Re : Re: Chat proximo - ThiagoMK - 28.07.2013

Quote:
Originally Posted by iCasTiel
Посмотреть сообщение
pawn Код:
if(text[0] == ';') {

    new Float:p[3],sStr[128],Name[21],MSG[3];

    GetPlayerName(playerid,Name,21);
    GetPlayerPos(playerid,p[0],p[1],p[2]);
    PlayerPlaySound(playerid,1057,0.0,0.0,0.0);

    for(new i; i != MAX_PLAYERS; i++) {

        if(IsPlayerInRangeOfPoint(i, 15.0,p[0],p[1],p[2])) {

            if(MSG[i] == 0) {

                format(sStr,128,"(Chat Prox){FF0000}%s (%i): {00FFFF}%s",Name,playerid,text[1]);
                SendClientMessage(i,-1,sStr);
                PlayerPlaySound(i,1057,0.0,0.0,0.0);
                MSG[i] = 1;
            }
            MSG[i] = 0;
            return 0;
        }
    }
}
Nгo era mais fбcil usar https://sampwiki.blast.hk/wiki/LimitGlobalChatRadius ?
Vlw mais acho que nгo era nгo '-'