[AJUDA] Chat Prуximo esta Duplicando Mensagem a Quem Escreve
#1

Script:

Quote:

if(text[0] == ';')
{
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
for(new i; i != MAX_PLAYERS; i++)
{
new Float[3];
GetPlayerPos(i,p[0],p[1],p[2]);
if(IsPlayerInRangeOfPoint(playerid,15.0,p[0],p[1],p[2]))
{
if(MSG[i] == false)
{
new sStr[256];
new Name[24];
GetPlayerName(playerid,Name,24);
format(sStr,128,"%s(%i): %s",Name,playerid,text[1]);
SendClientMessage(i,0x00FFFFAA,sStr);
SendClientMessage(playerid,0x00FFFFAA,sStr);
PlayerPlaySound(i,1057,0.0,0.0,0.0);
MSG[i] = true;
}
MSG[i] = false;
return 0;
}
}
}

Ele duplica a mensagem ao player que escreve-a, para quem lк estб normal!
Teria como alguem colocar chat bubble nele? eu faзo e da erros :/
Abraзгo
Reply
#2

pawn Код:
public OnPlayerText(playerid, text[])
{
     if(text[0] = ';' && text[1] = ' ')
     {
          new
          Float:p[3],
          string[128],
          player[MAX_PLAYER_NAME];
          GetPlayerName(playerid, player, sizeof(player));
          GetPlayerPos(playerid, p[0], p[1], p[2]);
          strdel(text, 0, 2);
          format(string, sizeof(string), "%s: %d %s", player, playerid, text);
          for(new i = 0; i < GetMaxPlayers(); i++)
          {
               if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i, 25.0, p[0], p[1], p[2]))
               {
                    SendClientMessage(i, -1, string);
               }
          }
          return false;
     }
     return true;
}
mais um tуpico sobre isso ? lol ! resolvido ?
Reply
#3

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

Fods

FOI FAIL MEU traveca rs
-qqq
Reply
#5

Jaja testo
Reply
#6

Olha o duble emo! o meu CODE funfa, nem vem !
Reply
#7

tudo q eu fiz foi tirar 1 linha do codigo.
Reply
#8

Eu peguei o cуdigo do Pharrel

pq tem o som '-'
uaauhauahu'

Funciono, de noite eu vo testar com outro player pq ta meio tenso esse chat proximo
se vc meche nele
nao apareзe a msg ao outro player ou apareзe sу a mensagem nem nick
tals

й foda
Reply
#9

Sу pra constar, pra vc aprender, no seu codigo pra mandar a msg tinha essas duas linhas:

pawn Код:
SendClientMessage(i,0x00FFFFAA,sStr);
SendClientMessage(playerid,0x00FFFFAA,sStr);
o (i,...) significa q vai mandar pra todos os players q estiverem naquela area, INCLUINDO O PLAYER QUE MANDOU A MENSAGEM entao o (playerid,...) era desnecessбrio, por isso ele mandava 2x, pq ele pegava o id do playerid 2x...espero q tenha entendido...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)