[Ajuda] Bug com chat prуximo
#1

Code:
static
        Float:Y,
        Float:X,
        Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    for(new i, e = GetMaxPlayers(); i != e; i++)
    {
        if(IsPlayerInRangeOfPoint(i, 100.0, X, Y, Z))
        {
            if(IsPlayerConnected(i))
            {
                new string[256];
				format(string,sizeof(string),"[ID: %d] %s",playerid,text);
                SendClientMessage(i, -1, text);
            }
        }
    }
    return 0;
}
Esta funcionando perfeitamente, mais nгo aparece o ID e nem NOME do PLAYER
simplesmente sу a mensagem pura, sem nada! me ajudem
Reply
#2

PHP Code:
//Coloca no inнcio do GM, para mais otimizaзгo.
new zName[24];
stock ReturnName(playerid)
{
    
GetPlayerName(playeridzName24);
    return 
zName;
}
static
        
Float:cPos[3];
    
GetPlayerPos(playeridcPos[0], cPos[1], cPos[2]);
    for(new 
i!= MAX_PLAYERS; ++i)
    {
        if(
IsPlayerInRangeOfPoint(i100.0cPos[0], cPos[1], cPos[2]))
        {
            if(
IsPlayerConnected(i))
            {
                new 
string[256];
                
format(string,sizeof(string),"[%d] %s diz: %s"playeridReturnName(playerid), text);
                
SendClientMessage(i, -1text);
            }
        }
    }
    return 
0;

Reply
#3

Quote:
Originally Posted by GuiKommander
View Post
PHP Code:
//Coloca no inнcio do GM, para mais otimizaзгo.
new zName[24];
stock ReturnName(playerid)
{
    
GetPlayerName(playeridzName24);
    return 
zName;
}
static
        
Float:cPos[3];
    
GetPlayerPos(playeridcPos[0], cPos[1], cPos[2]);
    for(new 
i!= MAX_PLAYERS; ++i)
    {
        if(
IsPlayerInRangeOfPoint(i100.0cPos[0], cPos[1], cPos[2]))
        {
            if(
IsPlayerConnected(i))
            {
                new 
string[256];
                
format(string,sizeof(string),"[%d] %s diz: %s"playeridReturnName(playerid), text);
                
SendClientMessage(i, -1text);
            }
        }
    }
    return 
0;

Continuou o mesmo problema amigo, sу a mensagem sem o id e nome
OBS: Й pra samp android
Reply
#4

Quote:
Originally Posted by RayanSanty
View Post
Continuou o mesmo problema amigo, sу a mensagem sem o id e nome
OBS: Й pra samp android
PHP Code:
static Float:cPos[3];
        
    
GetPlayerPos(playeridcPos[0], cPos[1], cPos[2]);
    new 
string[128];
    
    for(new 
iGetPlayerPoolSize(); <= j++ )
    {
        if(
IsPlayerInRangeOfPoint(i100.0cPos[0], cPos[1], cPos[2]))
        {
            if(
IsPlayerConnected(i))
            {
                
format(stringsizeof(string), "[%d] %s diz: %s"playeridReturnName(playerid), text);
                
SendClientMessage(i, -1string);
            }
        }
    }
    return 
0;

Reply
#5

Quote:
Originally Posted by FerrariL
View Post
PHP Code:
static Float:cPos[3];
        
    
GetPlayerPos(playeridcPos[0], cPos[1], cPos[2]);
    new 
string[128];
    
    for(new 
iGetPlayerPoolSize(); <= j+
        if(
IsPlayerInRangeOfPoint(i100.0cPos[0], cPos[1], cPos[2]))
        {
            if(
IsPlayerConnected(i))
            {
                
format(stringsizeof(string), "[%d] %s diz: %s"playeridReturnName(playerid), text);
                
SendClientMessage(i, -1string);
            }
        }
    }
    return 
0;

deu esse ъnico erro
Code:
C:\Users\Administrador\Documents\VE SE VAI\TESTEEE\gamemodes\GM.pwn(2471) : error 017: undefined symbol "GetPlayerPoolSize"
Reply
#6

Quote:
Originally Posted by RayanSanty
View Post
deu esse ъnico erro
Code:
C:\Users\Administrador\Documents\VE SE VAI\TESTEEE\gamemodes\GM.pwn(2471) : error 017: undefined symbol "GetPlayerPoolSize"
Atualize sua include do samp, ou entгo mantenha o looping como estava, com o MAX_PLAYERS (nгo recomendo).
Reply
#7

Quote:

Atualize sua include do samp, ou entгo mantenha o looping como estava, com o MAX_PLAYERS (nгo recomendo)

Qual include?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)