SA-MP Forums Archive
[Ajuda] Mensagem prуximo ao player. - 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] Mensagem prуximo ao player. (/showthread.php?tid=356187)



Mensagem prуximo ao player. - Bieeel_Cwb - 02.07.2012

Queria saber como que coloca esta mensagem aparecer sу pra quem estб perto do player?


PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    
GetPlayerName(playeridsendernamesizeof(sendername));
    
format(stringsizeof(string), "%s entrou no Veiculo."sendernameplayerid);
    
SendClientMessageToAll(0x8080FFAAstring);
    return 
1;




Re: [Ajuda] Como .. - paulor - 02.07.2012

http://forum.sa-mp.com/showpost.php?...postcount=1791


Re: [Ajuda] Como .. - Bieeel_Cwb - 02.07.2012

Valeu cara. +rep


Re: [Ajuda] Como .. - .FuneraL. - 02.07.2012

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new Float:x, Float:y, Float:z;    
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s entrou no Veiculo.", sendername, playerid);
    GetPlayerPos(playerid, x, y, z);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {  
         if(IsPlayerInRangeOfPoint(i, 15.0, x,y,z))
         {
             SendClientMessage(i, -1, string);
         }
    }
    return 1;
}
Tente Assim ^^

@Edit - Atrasei d+ kkkk'


Re: [Ajuda] Como .. - Brazuca[]s - 02.07.2012

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s entrou no Veiculo.", sendername, playerid);
    ProxDetector(10.0, playerid, string, 0x8080FFAA, 0x8080FFAA, 0x8080FFAA, 0x8080FFAA, 0x8080FFAA);
    return 1;
}



Re: [Ajuda] Como .. - Bieeel_Cwb - 02.07.2012

deu esse erro no seu brazucas.
error: 017: undefined symbol "ProxDetector"


Re: [Ajuda] Como .. - Brazuca[]s - 02.07.2012

No topo do gamemode:

pawn Код:
forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
E adicione esta public abaixo de outra public:

pawn Код:
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
    if(IsPlayerConnected(playerid))
    {
        new Float:posx, Float:posy, Float:posz;
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
            {
                GetPlayerPos(i, posx, posy, posz);
                tempposx = (oldposx -posx);
                tempposy = (oldposy -posy);
                tempposz = (oldposz -posz);
                if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16))) // If the player is within 16 meters
                {
                    SendClientMessage(i, col1, string);
                }
                else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8))) // within 8 meters
                {
                    SendClientMessage(i, col2, string);
                }
                else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4))) //4 meters
                {
                    SendClientMessage(i, col3, string);
                }
                else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2))) //2 meters
                {
                    SendClientMessage(i, col4, string);
                }
                else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) //1 meter
                {
                    SendClientMessage(i, col5, string);
                }
            }
            else
            {
                SendClientMessage(i, col1, string);
            }
        }
    }
    return 1;
}



Re: [Ajuda] Como .. - Bieeel_Cwb - 02.07.2012

Valeu mlkote, +rep!