SA-MP Forums Archive
[Ajuda]Sistema Say - 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: [Ajuda]Sistema Say (/showthread.php?tid=346922)



[Ajuda]Sistema Say - blacktrindade - 30.05.2012

Boa Tarde
Criei meio que um sistema de Say(Sistema de Say = Oque o Player falar so mostra para quem esta a tantos metros dele) no entanto devo estar fazendo errado, pois quando o player fala aparece para todos do servidor e em seguida repete como Say:

Sistema:
pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[256], name[24];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "%s diz: %s", name, text);
    SetPlayerChatBubble(playerid, text, -1, 100.0, 10000);
    new Float:XYZ[3];
    GetPlayerPos(playerid, XYZ[0], XYZ[1], XYZ[2]);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerInRangeOfPoint(i, 10.0, XYZ[0], XYZ[1], XYZ[2]))
            {
    SendClientMessage(i, -1, string);
        }
    }
    return 1;
}



Re: [Ajuda]Sistema Say - paulor - 30.05.2012

Quote:
Originally Posted by blacktrindade
Посмотреть сообщение
Boa Tarde
Criei meio que um sistema de Say(Sistema de Say = Oque o Player falar so mostra para quem esta a tantos metros dele) no entanto devo estar fazendo errado, pois quando o player fala aparece para todos do servidor e em seguida repete como Say:

Sistema:
pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[256], name[24];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "%s diz: %s", name, text);
    SetPlayerChatBubble(playerid, text, -1, 100.0, 10000);
    new Float:XYZ[3];
    GetPlayerPos(playerid, XYZ[0], XYZ[1], XYZ[2]);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerInRangeOfPoint(i, 10.0, XYZ[0], XYZ[1], XYZ[2]))
            {
    SendClientMessage(i, -1, string);
        }
    }
    return 1;
}
pawn Код:
return 0;
Se nгo vai mandar 2 vezes a MSG.



This forum requires that you wait 120 seconds between posts. Please try again in 61 seconds.


Re: [Ajuda]Sistema Say - blacktrindade - 30.05.2012

Quote:
Originally Posted by paulor
Посмотреть сообщение
pawn Код:
return 0;
Se nгo vai mandar 2 vezes a MSG.



This forum requires that you wait 120 seconds between posts. Please try again in 61 seconds.
Caramba que furada que eu Dei obrigado Paulo +rep


Re: [Ajuda]Sistema Say - paulor - 30.05.2012

No Problem!