[Ajuda] Chat Proximo
#1

Estou tentando fazer um chat pra que apenas pessoas proximas uma das outras consigam se comunicar, sу que nгo estб funcionando, a mensagem simplesmente nгo aparece pra outra pessoa.

PHP Code:

public OnPlayerText(playeridtext[])
{
    if(
Player[playerid][pAdminLevel] > 0)
    {
        new 
string[180], FloatpPos[3];
        
GetPlayerPos(playeridpPos[0], pPos[1], pPos[2]);
        
format(stringsizeof(string), "%s %s[%d]: %s"GetPlayerAdminLevel(playerid), GetPlayerNameEx(playerid), playeridtext);
        for(new 
0MAX_PLAYERSi++)
        {
            if(
IsPlayerInRangeOfPoint(playerid10.0pPos[0], pPos[1], pPos[2]))
            {
                
SendClientMessage(,-1string);
                return 
0;
            }
        }
    }
    return 
1;

Reply
#2

No RangeOfPoint, vocк substitui playerid por i.
E retira return 0; no final do SendClientMessage.
Reply
#3

Quote:
Originally Posted by ipsLuan
View Post
No RangeOfPoint, vocк substitui playerid por i.
E retira return 0; no final do SendClientMessage.
Nгo foi.

Continua nгo vendo a mensagem e a mensagem duplica.



Se tiver com tempo, brota discord, Cauezin#2726
Reply
#4

PHP Code:
public OnPlayerText(playeridtext[]) 

    if(
Player[playerid][pAdminLevel] > 0
    { 
        new 
string[180], FloatpPos[3]; 
        
GetPlayerPos(playeridpPos[0], pPos[1], pPos[2]); 
        
format(stringsizeof(string), "%s %s[%d]: %s"GetPlayerAdminLevel(playerid), GetPlayerNameEx(playerid), playeridtext); 
        for(new 
0MAX_PLAYERSi++) 
        { 
            if(
IsPlayerInRangeOfPoint(i10.0pPos[0], pPos[1], pPos[2])) 
            { 
                
SendClientMessage(,-1string); 
            } 
        } 
    } 
    return 
0

Reply
#5

Quote:
Originally Posted by NWDMadara
View Post
PHP Code:
public OnPlayerText(playeridtext[]) 

    if(
Player[playerid][pAdminLevel] > 0
    { 
        new 
string[180], FloatpPos[3]; 
        
GetPlayerPos(playeridpPos[0], pPos[1], pPos[2]); 
        
format(stringsizeof(string), "%s %s[%d]: %s"GetPlayerAdminLevel(playerid), GetPlayerNameEx(playerid), playeridtext); 
        for(new 
0MAX_PLAYERSi++) 
        { 
            if(
IsPlayerInRangeOfPoint(i10.0pPos[0], pPos[1], pPos[2])) 
            { 
                
SendClientMessage(,-1string); 
            } 
        } 
    } 
    return 
0

Carlho, eu te amo seu lindo.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)