[AJUDA]CHAT
#1

Ai Galera Olha o Que Ta Acontecendo Com Meu Chat:





Public:

Quote:

public OnPlayerText( playerid , text[] )
{
if(text[0] == ';')
{
for(new i; i < MAX_PLAYERS; i++)
{
new Float[3];
GetPlayerPos(playerid,p[0],p[1],p[2]);
if(IsPlayerInRangeOfPoint(i,20.0,p[0],p[1],p[2]))
{
new sStr[128];
GetPlayerName(playerid,sStr,23);
format(sStr,128,"%s (%i): %s",sStr,playerid,text[1]);
SendClientMessage(i,-1,sStr);
SetPlayerChatBubble(playerid,text[1],COLOR_WHITE,20,6000);
return 0;
}
}
}
new string[256];
format(string,sizeof(string),"[ID:%d]:%s",playerid,text);
SendPlayerMessageToAll(playerid,string);
SetPlayerChatBubble(playerid,string,COLOR_WHITE,10 0,6000);
return 1;
}

Reply
#2

pawn Код:
new string[256];
format(string,sizeof(string),"[ID:%d]:%s",playerid,text);
SendPlayerMessageToAll(playerid,string);
SetPlayerChatBubble(playerid,string,COLOR_WHITE,10 0,6000);
Reply
#3

pawn Код:
public OnPlayerText( playerid , text[] )
{
   if(text[0] == ';')
   {
       for(new i; i < MAX_PLAYERS; i++)
       {
            new Float[3];
            GetPlayerPos(playerid,p[0],p[1],p[2]);
            if(IsPlayerInRangeOfPoint(i,20.0,p[0],p[1],p[2]))
            {
                new sStr[128];
                GetPlayerName(playerid,sStr,23);
                format(sStr,128,"%s (%i): %s",sStr,playerid,text[1]);
                SendClientMessage(i,-1,sStr);
                SetPlayerChatBubble(playerid,text[1],COLOR_WHITE,20,6000);
            }
       }
       return true;
   }
   new string[128];
   format(string,sizeof(string),"[ID:%d]:%s",playerid,text);
   SendPlayerMessageToAll(playerid,string);
   SetPlayerChatBubble(playerid,string,COLOR_WHITE,10 0,6000);
   return true;
}
tenta amigo.
Reply
#4

Aconteceu Mesma COisa :S.


Jonathan:

Quote:

D:\Usuarios\Documentos\Servidor SAMP [HS]\gamemodes\HSGM.pwn(2961) : error 017: undefined symbol "p"
D:\Usuarios\Documentos\Servidor SAMP [HS]\gamemodes\HSGM.pwn(2961) : warning 215: expression has no effect
D:\Usuarios\Documentos\Servidor SAMP [HS]\gamemodes\HSGM.pwn(2961) : error 001: expected token: ";", but found "]"
D:\Usuarios\Documentos\Servidor SAMP [HS]\gamemodes\HSGM.pwn(2961) : error 029: invalid expression, assumed zero
D:\Usuarios\Documentos\Servidor SAMP [HS]\gamemodes\HSGM.pwn(2961) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Reply
#5

cara apaga tudo e bota apenas isso
PHP код:
public OnPlayerText(playeridtext[])
{
   
LimitGlobalChatRadius(10);
   return 
1;

isso deixara que apenas quem estiver perto veja
Reply
#6

Cara na verdade o que vocк quer fazer ? vocк quer deixar normal ?

pawn Код:
public OnPlayerText( playerid , text[] )
{
   if(text[0] == ';')
   {
       for(new i; i < MAX_PLAYERS; i++)
       {
            new Float:p[3];
            GetPlayerPos(playerid,p[0],p[1],p[2]);
            if(IsPlayerInRangeOfPoint(i, 20.0,p[0],p[1],p[2]))
            {
                new sStr[128];
                GetPlayerName(playerid,sStr,23);
                format(sStr,128,"%s (%i): %s",sStr,playerid,text[1]);
                SendClientMessage(i,-1,sStr);
                SetPlayerChatBubble(playerid,text[1],COLOR_WHITE,20,6000);
            }
       }
       return true;
   }
   new string[128];
   format(string,sizeof(string),"[ID:%d]:%s",playerid,text);
   SendPlayerMessageToAll(playerid,string);
   SetPlayerChatBubble(playerid,string,COLOR_WHITE,10 0,6000);
   return true;
}
Reply
#7

Jonatha. Tipow Cara Eu TO Tentando Fazer Assim:

o Player USa: ";" antes das frases o texto vai para os player a 20 metros dele.

o chat global pode fika normal.

Obs: o Chat De Perto Tem Que Mostrar o ID e o Nome Igual o Global.
To Tentando Faz Meses Fazer Isso e Nao Dб :/
Reply
#8

pawn Код:
public OnPlayerText( playerid , text[] )
{
    new sStr[128],pName[20];
    if(text[0] == ';')
    {
        new Float:p[3];
        GetPlayerPos(playerid,p[0],p[1],p[2]);
        GetPlayerName(playerid,pName,20);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerInRangeOfPoint(i,20.0,p[0],p[1],p[2]))
            {                
                format(sStr,sizeof(sStr),"%s [ID:%d]:%s",pName,playerid,text);
                SendClientMessage(i,-1,sStr);
            }
        }
    }
    SendPlayerMessageToAll(playerid,sStr);
    SetPlayerChatBubble(playerid,sStr,COLOR_WHITE,10 0,6000);
    return 1;
}
Reply
#9

Vini Fiko Mesma Coisa :S
Reply
#10

PHP код:
public OnPlayerTextplayerid text[] )
{
    new 
sStr[128];
    
GetPlayerName(playeridsStr24);
    if(
text[0] == ";")
    {
        for(new 
iGetMaxPlayers(); pi++)
        {    
            if(!
IsPlayerConnected(i)) continue;
            new 
Float:p[3];
            
GetPlayerPos(playerid,p[0],p[1],p[2]);
            if(!
IsPlayerInRangeOfPoint(i20.0p[0], p[1], p[2])) continue;
            
            
strdel(text01);
            
format(sStr128,"[CHAT PROXIMO] {FFFFF}[ID %d]: %s"sStrplayeridtext);
            
SendClientMessage(i0xFF0000FFsStr);
            
SetPlayerChatBubble(playeridtextCOLOR_WHITE206000);
        }
        return 
false;
    }
    
format(sStr128,"[ID:%d] %s: %s"sStrplayeridtext);
    
SendPlayerMessageToAll(playeridsStr);
    
SetPlayerChatBubble(playeridtextCOLOR_WHITE1006000);
    return 
true;

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)