SA-MP Forums Archive
[Pedido] Chat Local - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Pedido] Chat Local (/showthread.php?tid=384696)



Chat Local - Nice-.- - 13.10.2012

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


Re: Chat Local - Ley - 13.10.2012

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.


Re: Chat Local - zSuYaNw - 13.10.2012

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;




Re: Chat Local - Delete_ - 13.10.2012

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
    } 



Re: Chat Local - BreakDriFT - 13.10.2012

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


Re: Chat Local - Jason` - 13.10.2012

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


Re: Chat Local - Nice-.- - 13.10.2012

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


Re: Chat Local - humildadeforever - 13.10.2012

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


Re: Chat Local - Bufige - 13.10.2012

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.




Re: Chat Local - Jason` - 13.10.2012

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.