SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 11/03/2019, 10:07 PM   #1
RayanSanty
Big Clucker
 
RayanSanty's Avatar
 
Join Date: Aug 2018
Location: Brazil
Posts: 146
Reputation: 1
Default Chat próximo

Preciso de ajuda pra mudar isso

Quero que quando o player digite apareca somente para todos proximo a ele
Aqui esta como chat global, me ajudem

Code:
new string[256];
format(string,sizeof(string),"[ID: %d] %s",playerid,text);
SendPlayerMessageToAll(playerid,string);
return 0;
}
RayanSanty is offline   Reply With Quote
Old 11/03/2019, 10:08 PM   #2
ipsLuan
High-roller
 
ipsLuan's Avatar
 
Join Date: Feb 2013
Location: Ilhéus, BA
Posts: 4,563
Reputation: 332
Default Re: Chat próximo

Loop + IsPlayerInRangeOfPoint.
__________________

Precisando de algum sistema? Chame!

ipsLuan is offline   Reply With Quote
Old 11/03/2019, 10:36 PM   #3
ipsLuan
High-roller
 
ipsLuan's Avatar
 
Join Date: Feb 2013
Location: Ilhéus, BA
Posts: 4,563
Reputation: 332
Default Re: Chat próximo

Quote:
Originally Posted by GGsamp View Post
Na callback OnPlayerText

if(text[0] == ';'){ChatProximo(playerid, COLOUR_CHATPROX, text[1]);return 0;}

Final do gm ou onde preferir

stock ChatProximo(playerid, color, const string[])
{
new output[128], pNameX[MAX_PLAYER_NAME],outadm[128],rawstring[128];
GetPlayerName(playerid, pNameX, sizeof(pNameX));

format(output, sizeof(output), "%s: (%i): %s", pNameX, playerid, string);
format(rawstring, sizeof(rawstring), "%s",string);

GetPlayerPos(playerid, PosX, PosY, PosZ);

format(outadm, sizeof(outadm), "CHATP >> %s: (%i): %s", pNameX,playerid,string);
for(new i; i < GetMaxPlayers(); i++){if(IsPlayerConnected(i)){
if(CallRemoteFunction("GetPlayerAdminLevel","i",i) >= 4){
if(!IsPlayerInRangeOfPoint(i, 20.0, PosX, PosY, PosZ)){
SendClientMessage(i, 0xFF9900AA, outadm);}}}}

for(new i; i < GetMaxPlayers(); i++){if(IsPlayerConnected(i)){
if(IsPlayerInRangeOfPoint(i, 20.0, PosX, PosY, PosZ)){
SendClientMessage(i, color, output);
PlayerPlaySound(i,1057,0.0,0.0,0.0);}}}
SetPlayerChatBubble(playerid, rawstring, COLOUR_CHATPROX, 20.0, 10000);

return 1;
}
Com essa callback, vai enviar a mensagem também se o jogador não estiver próximo.
__________________

Precisando de algum sistema? Chame!

ipsLuan is offline   Reply With Quote
Old 11/03/2019, 10:59 PM   #4
Malandrin
Huge Clucker
 
Malandrin's Avatar
 
Join Date: Jun 2018
Posts: 406
Reputation: 23
Default Re: Chat próximo

Eu utilizo essa, pois com essa pode configurar várias cores, dependendo da distância do jogador.

PHP Code:

ProxDetector
(Float:radiplayeridstring[], col1col2col3col4col5)
{
    new 
Float:oldposxFloat:oldposyFloat:oldposz;
    
GetPlayerPos(playeridoldposxoldposyoldposz);
    for(new 
i=0i<MAX_PLAYERSi++)
    {
        if(
GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid) && GetPlayerInterior(i) == GetPlayerInterior(playerid))
        {
            if(
IsPlayerInRangeOfPoint(iradi/16,oldposxoldposyoldposz)) SendClientMessage(icol1string);
            else if(
IsPlayerInRangeOfPoint(iradi/8,oldposxoldposyoldposz)) SendClientMessage(icol2string);
            else if(
IsPlayerInRangeOfPoint(iradi/4,oldposxoldposyoldposz)) SendClientMessage(icol3string);
            else if(
IsPlayerInRangeOfPoint(iradi/2,oldposxoldposyoldposz)) SendClientMessage(icol4string);
            else if(
IsPlayerInRangeOfPoint(iradi,oldposxoldposyoldposz)) SendClientMessage(icol5string);
        }
    }
    return 
1;

Malandrin is offline   Reply With Quote
Old 11/03/2019, 11:34 PM   #5
zF3lKy3
Big Clucker
 
Join Date: Aug 2018
Location: Fortaleza - CE
Posts: 154
Reputation: 0
Default Re: Chat próximo

Quote:
Originally Posted by GGsamp View Post
Na callback OnPlayerText

if(text[0] == ';'){ChatProximo(playerid, COLOUR_CHATPROX, text[1]);return 0;}

Final do gm ou onde preferir

stock ChatProximo(playerid, color, const string[])
{
new output[128], pNameX[MAX_PLAYER_NAME],outadm[128],rawstring[128];
GetPlayerName(playerid, pNameX, sizeof(pNameX));

format(output, sizeof(output), "%s: (%i): %s", pNameX, playerid, string);
format(rawstring, sizeof(rawstring), "%s",string);

GetPlayerPos(playerid, PosX, PosY, PosZ);

format(outadm, sizeof(outadm), "CHATP >> %s: (%i): %s", pNameX,playerid,string);
for(new i; i < GetMaxPlayers(); i++){if(IsPlayerConnected(i)){
if(CallRemoteFunction("GetPlayerAdminLevel","i",i) >= 4){
if(!IsPlayerInRangeOfPoint(i, 20.0, PosX, PosY, PosZ)){
SendClientMessage(i, 0xFF9900AA, outadm);}}}}

for(new i; i < GetMaxPlayers(); i++){if(IsPlayerConnected(i)){
if(IsPlayerInRangeOfPoint(i, 20.0, PosX, PosY, PosZ)){
SendClientMessage(i, color, output);
PlayerPlaySound(i,1057,0.0,0.0,0.0);}}}
SetPlayerChatBubble(playerid, rawstring, COLOUR_CHATPROX, 20.0, 10000);

return 1;
}
Sistema da Game-Mode do Bloody Vegas
zF3lKy3 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Ajuda] Prefixo admin no chat + chat proximo Ryuzaki07 Português/Portuguese 19 07/06/2019 04:25 PM
[Pedido] Chat Proximo. Supera Português/Portuguese 6 11/03/2019 11:22 PM
[Ajuda] Chat Proximo Jao157 Português/Portuguese 2 23/10/2014 04:15 AM
[Ajuda] <y> Chat Proximo <y> i7Core Português/Portuguese 4 21/01/2014 05:28 PM
[Ajuda] Chat Próximo Lord_Style Português/Portuguese 1 17/09/2012 06:59 PM


All times are GMT. The time now is 05:54 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.