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



If If > IsPlayerInRangeOfPoint - Rodox_Mortein - 14.01.2015

pawn Код:
CMD:abrirportabase(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 2.0, -882.71, 2759.00, 44.97))
    {
        if(Player[playerid][Organizacao] == GangueGrove)
        {
            KillTimer(timerportagrove);
            MoveObject(portagrove,-882.71, 2759.00, 44.97,1,   0.00, 0.00, -92.64);
            timerportaGrove = SetTimer("fecharportagrove", 5000, 0);
        }
    }
    else if(IsPlayerInRangeOfPoint(playerid, 2.0, -422.40, 612.66, 15.64))
    {
        if(Player[playerid][Organizacao] == GangueBallass)
        {
            KillTimer(timerportaballass);
            MoveObject(portaballass,-422.40, 612.66, 15.64,1,   0.00, 0.00, -15.54);
            timerportaballass = SetTimer("fecharportaballass", 5000, 0);
        }
    }
    else if(IsPlayerInRangeOfPoint(playerid, 2.0, 774.68, 1621.78, 4.74))
    {
        if(Player[playerid][Organizacao] == GangueVagos)
        {
            KillTimer(timerportavagos);
            MoveObject(portavagos,774.68, 1621.78, 4.74,1,   0.00, 0.00, -96.30);
            timerportavagos = SetTimer("fecharportavagos", 5000, 0);
        }
    }
    else if(IsPlayerInRangeOfPoint(playerid, 2.0, -511.81, 1898.73, 86.32))
    {
        if(Player[playerid][Organizacao] == GangueAztecas)
        {
            KillTimer(timerportaaztecas);
            MoveObject(portaaztecas,-511.81, 1898.73, 86.32,1,   0.00, 0.00, -241.74);
            timerportaaztecas = SetTimer("fecharportaaztecas", 5000, 0);
        }
    }
    else if(IsPlayerInRangeOfPoint(playerid, 2.0, -268.2000100,2610.8999000,1051.6000000))
    {
        if(Player[playerid][Organizacao] == Policia)
        {
            KillTimer(timerportapolicialp);
            MoveObject(portapolicialp,-268.2002000,2610.9004000,1051.6000000,1,   0.00, 0.00, 2.7470000);
            timerportapolicialp = SetTimer("fecharportapolicialp", 5000, 0);
        }
    }
    return 1;
}
Boa Noite.
To pelejando aqui e nгo consigo fazer funcionar x.x ... jб tentei de varias formas e nada... onde foi que eu errei?


Re: If If > IsPlayerInRangeOfPoint - DiegoLeo - 14.01.2015

Amigo, o que acontece? Explique mais sobre seu problema


Re: If If > IsPlayerInRangeOfPoint - Rodox_Mortein - 14.01.2015

Sу o comando da Grove que funciona.... o restante nгo funciona... jб tentei substituir o If por Else If e nads..


Re: If If > IsPlayerInRangeOfPoint - JonathanFeitosa - 14.01.2015

Com raio 2.0 fica difнcil mesmo, sу vai funcionar se vocк digitar o comando apenas colado onde tu pegou a coordenada.


Re: If If > IsPlayerInRangeOfPoint - DiegoLeo - 14.01.2015

Exatamente isso que o Jonathan disse, vocк deveria substituir o raio para 7 mais ou menos..
Onde estб : If(IsPlayerInRangeOfPoint(playerid, 2.0 .... vocк troca esse 2.0 por 7 e testa


Re: If If > IsPlayerInRangeOfPoint - Rodox_Mortein - 14.01.2015

Quote:
Originally Posted by JonathanFeitosa
Посмотреть сообщение
Com raio 2.0 fica difнcil mesmo, sу vai funcionar se vocк digitar o comando apenas colado onde tu pegou a coordenada.
eu sei...

o problema й que nгo ta funfando os If que fica dentro dos Else If

to tentando resolver o problema estudando isso aqui + ta ossow https://sampwiki.blast.hk/wiki/Control_Structures


Re: If If > IsPlayerInRangeOfPoint - DiegoLeo - 14.01.2015

Mesmo vocк sendo da ORG ballas o portгo dos ballas nгo abre?


Re: If If > IsPlayerInRangeOfPoint - Rodox_Mortein - 14.01.2015

Nгo jб tentei em todas as orgs e sу a primeira (Grove) funciona


Re: If If > IsPlayerInRangeOfPoint - DiegoLeo - 14.01.2015

Tem Skype?


Re: If If > IsPlayerInRangeOfPoint - MultiKill - 14.01.2015

Faзa um desbug no cуdigo, vai fazendo isto:
pawn Код:
else if(IsPlayerInRangeOfPoint(playerid, 2.0, -422.40, 612.66, 15.64))
    {
        else SendClientMessage(playerid, -1, "Voc~e estб nas coordenadas do portгo dos Ballas");
        if(Player[playerid][Organizacao] == GangueBallass)
        {
            KillTimer(timerportaballass);
            MoveObject(portaballass,-422.40, 612.66, 15.64,1,   0.00, 0.00, -15.54);
            timerportaballass = SetTimer("fecharportaballass", 5000, 0);
        }
        else SendClientMessage(playerid, -1, "Vocк nгo й da gangue dos Ballas.");
    }
Vai fazendo isto no cуdigo, e testa que vocк vai achar o problema.