[Pedido] Chat Local
#1

Bom Eu Queria Saber Como Deixaro Chat Local Sу Para Players Que Estгo Perto
Reply
#2

Quote:
Originally Posted by Nice-.-
Посмотреть сообщение
Bom Eu Queria Saber Como Deixaro Chat Local Sу Para Players Que Estгo Perto
Se for chat, baixe um GM RP, e pegue o chat...
Se for comando \/

PHP код:
CMD:p(playeridparams[])
{
    if(!
strlen(params)) return SendClientMessage(playerid, -1"assim: /p [mensagem]");
    
format(params128"pertъ >> %s: %s"name ,params);
    }
    return 
1;

Boa sorte.
Reply
#3

Quote:
Originally Posted by Ley
Посмотреть сообщение
Se for chat, baixe um GM RP, e pegue o chat...
Se for comando \/

PHP код:
CMD:p(playeridparams[])
{
    if(!
strlen(params)) return SendClientMessage(playerid, -1"assim: /p [mensagem]");
    
format(params128"pertъ >> %s: %s"name ,params);
    }
    return 
1;

Boa sorte.
Formatar o Parвmetros ?


PHP код:
CMD:p(playeridparams[])
{
    if(!
strlen(params) || ((params[0] == ' ') || (params[0] == EOS)))
        return 
SendClientMessage(playerid, -1"assim: /p [mensagem]");
        
    static 
Float:XFloat:YFloat:Z str[100],nome;
    
    
str params[2];
    
    
format(str128"%s: %s", (GetPlayerName(playeridnome24), nome),  str);
    return 
1;

Reply
#4

PHP код:
if(!strcmp(cmd"/p"true)) 
    { 
        new 
tmp[128]; 
        
GetPlayerName(playeridPlayerNamesizeof(PlayerName)); 
        
strmid(tmpcmdtext3strlen(cmdtext), 128); 
        if(!
strlen(tmp)) return SendClientMessage(playerid, -1"/f [texto]"); 
        new 
Float:diegox,Float:diegoy,Float:diegoz
        
format(tmpsizeof(tmp), "|»»| Chat Prуximo |««| %s: %s"PlayerName(playerid), tmp); 
        
GetPlayerPos(playeriddiegoxdiegoydiegoz); 
        for(new 
chatchat MAX_PLAYERSchat++) 
        { 
            if(
IsPlayerInRangeOfPoint(diego10.0diegoxdiegoydiegoz)) 
            { 
                
SendClientMessage(diego, -1tmp); 
            } 
        } 
        return 
1
    } 
Reply
#5

PHP код:
public OnGameModeInit()
{
    
LimitGlobalChatRadius(200.0);
    return 
1;

Todos os jogadores que estiverem em um raio de 200.0 vгo ver o chat.


Link para wiki:
https://sampwiki.blast.hk/wiki/LimitGlobalChatRadius
Reply
#6

PHP код:
cmd(pplayeridparams[]) {
    if(
isnull(params))
        return 
1;
    
    static
        
Floatpx,
        
Floatpy,
        
Floatpz,
        
name[24],
        
i
    
;
    
    
GetPlayerPos(playeridpxpypz);
    
format(params128"%s: %s", (GetPlayerName(playeridnamesizeof(name)), name), params);
    
    for(
GetMaxPlayers(); > -1; --i) {
    
        if(
IsPlayerConnected(i)) {
            if(
IsPlayerInRangeOfPoint(i5.0pxpypz)) {
            
                
SendClientMessage(i0x828282FFparams);
            }
        }
    }
    return 
1;

Isto se for por comando, caso queira sempre, basta fazer o que disse o BreakDriFT
Reply
#7

Quote:
Originally Posted by Jason`
Посмотреть сообщение
PHP код:
cmd(pplayeridparams[]) {
    if(
isnull(params))
        return 
1;
    
    static
        
Floatpx,
        
Floatpy,
        
Floatpz,
        
name[24],
        
i
    
;
    
    
GetPlayerPos(playeridpxpypz);
    
format(params128"%s: %s", (GetPlayerName(playeridnamesizeof(name)), name), params);
    
    for(
GetMaxPlayers(); > -1; --i) {
    
        if(
IsPlayerConnected(i)) {
            if(
IsPlayerInRangeOfPoint(i5.0pxpypz)) {
            
                
SendClientMessage(i0x828282FFparams);
            }
        }
    }
    return 
1;

Isto se for por comando, caso queira sempre, basta fazer o que disse o BreakDriFT
nгo й comando tiu й chat local mesmo "T" digita
Reply
#8

Pode usar a funзгo que o Break postou ou format + loop + IsPlayerInRangeOfPoint + SendClientMessage.
Reply
#9

PHP код:
public OnPlayerText(playeridtext[])
{
    static 
nome[24], Float:Float:Float:;
    
formattext 128 ,"%s : %s" , ( GetPlayerName playerid nome sizeof nome ) ) , text) ;
    
GetPlayerPos(playerid);
    for( 
i  =  GetMaxPlayers() ;  i  >  -; --)
    {
       if( ! 
IsPlayerInRangeOfPoint 50.0 ) ) continue; // sem necessidade de isplayerconnected, pois o jogador sу vai esta em tal pos se estiver conectado.
       
SendClientMessage ,  -,  text );
    }
    return 
// return 0, para nгo mandar a mesma bosta.

Reply
#10

Quote:
Originally Posted by Bufige
Посмотреть сообщение
PHP код:
public OnPlayerText(playeridtext[])
{
    static 
nome[24], Float:Float:Float:;
    
formattext 128 ,"%s : %s" , ( GetPlayerName playerid nome sizeof nome ) ) , text) ;
    
GetPlayerPos(playerid);
    for( 
i  =  GetMaxPlayers() ;  i  >  -; --)
    {
       if( ! 
IsPlayerInRangeOfPoint 50.0 ) ) continue; // sem necessidade de isplayerconnected, pois o jogador sу vai esta em tal pos se estiver conectado.
       
SendClientMessage ,  -,  text );
    }
    return 
// return 0, para nгo mandar a mesma bosta.

Ou somente LimitGlobalChatRadius.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)