SA-MP Forums Archive
[Ajuda] Aparece perto - 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] Aparece perto (/showthread.php?tid=336068)



[Ajuda] Aparece perto - [NVC]Eduardo - 21.04.2012

Jб fiz de tudo, mas nгo consigo й o seguinte, para aparece apenas para as pessoas que estгo prуximas, o comando de contagem.
code:
pawn Код:
if(strcmp(cmd, "/contagem", true) == 0)
{
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    format(file, sizeof(file), PASTA_CONTAS, aname);
    if(pAdmin[playerid] == 5) {

        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) {
            SendClientMessage(playerid, Vermelho, "Uso: /contagem [quantia]");
            return 1;
        }
        new contando = strval(tmp);
        for(new i=0; i < MAX_PLAYERS; i++) {
            if(noevento[i] == 1) {
                contar[i] = contando;
                contagem[i] = SetTimerEx("Contagem", 1000, true, "i", i);
            }
        }
    }
    else {
        SendClientMessage(playerid, Vermelho, "* Vocк nгo tem acesso a esse comando!");
    }
    return 1;
}
+REP


Re: [Ajuda] Aparece perto - @Riichard - 21.04.2012

Adicione no code :
pawn Код:
new Float:Coords[3];
GetPlayerPos(playerid,Coords[0],Coords[1],Coords[2]);
for(new x = 0; x != MAX_PLAYERS; x++)
{
if(IsPlayerInRangeOfPoint(x,80.0,Coords[0],Coords[1],Coords[2])) // Onde esta 80.0 = a distancia,para ser vista.
{
Uso em meu gm TDM..
se der erro avise.


Re: [Ajuda] Aparece perto - dPlaYer_ - 21.04.2012

pawn Код:
if(strcmp(cmd, "/contagem", true) == 0)
{
    if(pAdmin[playerid] == 5)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, Vermelho, "Uso: /contagem [quantia]");
            return 1;
        }
        new contando = strval(tmp);
        for(new i=0; i < MAX_PLAYERS; i++)
        {
            if(noevento[i] == 1)
            {
                if(GetDistanceBetweenPlayers(playerid, i) < 25)
                {
                    contar[i] = contando;
                    contagem[i] = SetTimerEx("Contagem", 1000, true, "i", i);
                }
            }
        }
        else {
            SendClientMessage(playerid, Vermelho, "* Vocк nгo tem acesso a esse comando!");
        }
        return 1;
    }



Re: [Ajuda] Aparece perto - [NVC]Eduardo - 21.04.2012

Quote:
Originally Posted by @Riichard
Посмотреть сообщение
Adicione no code :
pawn Код:
new Float:Coords[3];
GetPlayerPos(playerid,Coords[0],Coords[1],Coords[2]);
for(new x = 0; x != MAX_PLAYERS; x++)
{
if(IsPlayerInRangeOfPoint(x,80.0,Coords[0],Coords[1],Coords[2])) // Onde esta 80.0 = a distancia,para ser vista.
{
Uso em meu gm TDM..
se der erro avise.
Nem deu
-
[LF]Player funfo +rep para vocк;