SA-MP Forums Archive
[Pedido] 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: [Pedido] Chat Proximo. (/showthread.php?tid=376517)



Chat Proximo. - Supera - 10.09.2012

Alguem tem um sistema de chat proximo ou pode criar usando ; ou ! para apenas os pleyers que estгo proximo poder ler?
jб tentei esse sistema : https://sampforum.blast.hk/showthread.php?tid=280496 , mais ta bugado.


Re: [PEDIDO]Chat Proximo. - .FuneraL. - 10.09.2012

pawn Code:
public OnPlayerText(playerid, text[])
{
     if(text[0] == '!')
     {
          new Float:Pos[3], Name[24], string[128];
          GetPlayerName(playerid, Name, sizeof(Name));
          GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
          format(string, sizeof(string), "%s Diz: %s", Name, text[1])
          for(new i = 0; i < MAX_PLAYERS; i++)
          {
               if(IsPlayerInRangeOfPoint(i, 50.0, Pos[0], Pos[1], Pos[2]))
               {
                     Msg(i, -1, string);
                }
           }
      }
      return 1;
}
Tenta Aн


Re: [PEDIDO]Chat Proximo. - Douglas_prt - 10.09.2012

Leia este tutorial de chats RP que tem lб a soluзгo:

https://sampforum.blast.hk/showthread.php?tid=336052


Respuesta: [PEDIDO]Chat Proximo. - Supera - 10.09.2012

Code:
public OnPlayerText(playerid, text[])
{
     if(text[0] == '!')
     {
          new Float:Pos[3], Name[24], string[128];
          GetPlayerName(playerid, Name, sizeof(Name));
          GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
          format(string, sizeof(string), "%s Diz: %s", Name, text[1])
          for(new i = 0; i < MAX_PLAYERS; i++)
          {
               if(IsPlayerInRangeOfPoint(i, 50.0, Pos[0], Pos[1], Pos[2]))
               {
                     Msg(i, -1, string);
                }
           }
      }
      return 1;
}
Deu 2 erros, Linhas :

Code:
for(new i = 0; i < MAX_PLAYERS; i++)
Code:
 Msg(i, -1, string);
@ Edit
Eu queria um chat proximo mais sem tirar o chat global tambйm


Re: [PEDIDO]Chat Proximo. - Douglas_prt - 10.09.2012

pawn Code:
public OnPlayerText(playerid, text[])
{
     if(text[0] == '!')
     {
          new Float:Pos[3], Name[24], string[128];
          GetPlayerName(playerid, Name, sizeof(Name));
          GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
          format(string, sizeof(string), "%s Diz: %s", Name, text[1]); // Faltava o ;
          for(new i = 0; i < MAX_PLAYERS; i++)
          {
               if(IsPlayerInRangeOfPoint(i, 50.0, Pos[0], Pos[1], Pos[2]))
               {
                     SendClientMessage(i, -1, string);
               }
           }
      }
      return 1;
}



Respuesta: Re: [PEDIDO]Chat Proximo. - Supera - 10.09.2012

Quote:
Originally Posted by Douglas_prt
View Post
pawn Code:
public OnPlayerText(playerid, text[])
{
     if(text[0] == '!')
     {
          new Float:Pos[3], Name[24], string[128];
          GetPlayerName(playerid, Name, sizeof(Name));
          GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
          format(string, sizeof(string), "%s Diz: %s", Name, text[1]); // Faltava o ;
          for(new i = 0; i < MAX_PLAYERS; i++)
          {
               if(IsPlayerInRangeOfPoint(i, 50.0, Pos[0], Pos[1], Pos[2]))
               {
                     SendClientMessage(i, -1, string);
               }
           }
      }
      return 1;
}
Funcionou mais quando eu digito uma menssagem aparece 2 vezes. Mostra no chat global uma menssagem no chat global e uma no chat proximo, fazendo com quem estб proximo leia duas vezes a menssagem.


Re: Chat Proximo. - AutoMatic2 - 11.03.2019

Quote:
Originally Posted by RayanSanty
Quero que quando o player digite apareca somente para todos proximo a ele Aqui esta como chat global, me ajudem
@Removido!