SA-MP Forums Archive
[Ajuda] PQ esse comando nгo estб funfando - 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] PQ esse comando nгo estб funfando (/showthread.php?tid=437243)



PQ esse comando nгo estб funfando - Cromado - 14.05.2013

Eu descarrego nos postos e nгo ganha o dinhero .-. como fasso isso eu fis assim acho que estб errado

pawn Код:
if (strcmp(cmd, "/descarregarp", true) == 0)
{
if (PlayerToPoint(60.0, playerid, 1935.5637,-1771.5033,13.382) || PlayerToPoint(60.0, playerid, 610.0511,1700.9008,6.9922))
if(dini_Int(file, "Profissao") == Petroleiro){
if (PlayerToPoint(60.0, playerid, 610.0511,1700.9008,6.9922))
    {
  GivePlayerGrana(playerid, 80);
}
if (PlayerToPoint(60.0, playerid, 69.7854,1219.2927,18.8093))
{
    GivePlayerGrana(playerid, 70);
}
else if (PlayerToPoint(60.0, playerid, -1676.2520,413.1227,7.1797))//3
{
    GivePlayerGrana(playerid, 920);
}
else if  (PlayerToPoint(60.0, playerid, -89.3602,-1165.5499,2.3493))//4
{
    GivePlayerGrana(playerid, 500);
}
else    if (PlayerToPoint(60.0, playerid, 1002.8900,-941.1104,42.1797))//5
{
    GivePlayerGrana(playerid, 850);
}
else    if (PlayerToPoint(60.0, playerid, 1938.6797,-1770.5103,13.3828))//6
{
    GivePlayerGrana(playerid, 1200);
}
else    if (PlayerToPoint(60.0, playerid, -1605.5865,-2713.5432,48.5335))//7
{
    GivePlayerGrana(playerid, 1350);
}
else    if (PlayerToPoint(60.0, playerid, 670.6545,1726.7865,7.1875))//8
{
    GivePlayerGrana(playerid, 900);
}
    }
   else
    {
    if (Carregamento[playerid] == 1)
        {
            SendClientMessage(playerid, Vermelho, "** Seu veнculo nгo estб carregado!");
            return 1;
        }
        else
        {
            Carregamento[playerid] = 1;
            SendClientMessage(playerid, 0x99FFFFAA, "* Seu Veiculo Foi descarregado e Vocк ganhou.");
            SetVehicleToRespawn(GetVehicleTrailer(GetPlayerVehicleID(playerid)));
                return 1;
            }
        }

        {
        SendClientMessage(playerid, Vermelho, "** Vocк nгo esta no check de descarga.");
        return 1;
    }
}
Sу quero que descarrega em qualquer posto tenho todas as cordenadas mais nгo estб dando certo

alguem da uma ajuda valendo reply


Re: PQ esse comando nгo estб funfando - AlucardSnow - 14.05.2013

Coloca:
PHP код:
GivePlayerMoney(playerid, GranaAqui); 



Re: PQ esse comando nгo estб funfando - Wellington1999 - 14.05.2013

pawn Код:
if (strcmp(cmd, "/descarregarp", true) == 0)
{
if (PlayerToPoint(60.0, playerid, 1935.5637,-1771.5033,13.382) || PlayerToPoint(60.0, playerid, 610.0511,1700.9008,6.9922))
if(dini_Int(file, "Profissao") == Petroleiro){
if (PlayerToPoint(60.0, playerid, 610.0511,1700.9008,6.9922))
    {
  GivePlayerGrana(playerid, 80);
}
if (PlayerToPoint(60.0, playerid, 69.7854,1219.2927,18.8093))
{
    GivePlayerGrana(playerid, 70);
}
else if (PlayerToPoint(60.0, playerid, -1676.2520,413.1227,7.1797))//3
{
    GivePlayerGrana(playerid, 920);
}
else if  (PlayerToPoint(60.0, playerid, -89.3602,-1165.5499,2.3493))//4
{
    GivePlayerGrana(playerid, 500);
}
else    if (PlayerToPoint(60.0, playerid, 1002.8900,-941.1104,42.1797))//5
{
    GivePlayerGrana(playerid, 850);
}
else    if (PlayerToPoint(60.0, playerid, 1938.6797,-1770.5103,13.3828))//6
{
    GivePlayerGrana(playerid, 1200);
}
else    if (PlayerToPoint(60.0, playerid, -1605.5865,-2713.5432,48.5335))//7
{
    GivePlayerGrana(playerid, 1350);
}
else    if (PlayerToPoint(60.0, playerid, 670.6545,1726.7865,7.1875))//8
{
    GivePlayerGrana(playerid, 900);
}
    }
   else
    {
    if (Carregamento[playerid] == 1)
        {
            SendClientMessage(playerid, Vermelho, "** Seu veнculo nгo estб carregado!");
            return 1;
        }
        else
        {
            Carregamento[playerid] = 1;
            SendClientMessage(playerid, 0x99FFFFAA, "* Seu Veiculo Foi descarregado e Vocк ganhou 100 R$.");
            SetVehicleToRespawn(GetVehicleTrailer(GetPlayerVehicleID(playerid)));
           GivePlayerMoney(playerid, 100);  //100 reais por exemplo
                return 1;
            }
        }

        {
        SendClientMessage(playerid, Vermelho, "** Vocк nгo esta no check de descarga.");
        return 1;
    }
}



Re: PQ esse comando nгo estб funfando - mau.tito - 14.05.2013

pawn Код:
#define          GivePlayerGrana(%0,%1)                    GivePlayerMoney(%0,%1)



Re: PQ esse comando nгo estб funfando - PT - 15.05.2013

Nao precisa de tantos
pawn Код:
GivePlayerGrana(playerid, grana);
basta onde diz a frase "... Foi descarregado..."



Porque se nao ele pode estar naquele lugar mas nгo tar carregado e recebe a grana na mesma....


Re: PQ esse comando nгo estб funfando - ProKillerpa - 15.05.2013

Nгo, @PT.

Se colocar lб ele vai receber apenas um valor, mas ele quer que tenha vбrios postos com variados pagamentos por distвncia.


Re: PQ esse comando nгo estб funfando - PT - 15.05.2013

Quote:
Originally Posted by ProKillerpa
Посмотреть сообщение
Nгo, @PT.

Se colocar lб ele vai receber apenas um valor, mas ele quer que tenha vбrios postos com variados pagamentos por distвncia.
Mesmo assim ele nao pode fazer daquela forma, tem de fazer algo deste genero;

pawn Код:
if(strcmp(cmd, "/descarregarp", true) == 0)
{
    if(PlayerToPoint(60.0, playerid, 610.0511,1700.9008,6.9922) || PlayerToPoint(60.0, playerid, 69.7854,1219.2927,18.8093)
        || PlayerToPoint(60.0, playerid, -1676.2520,413.1227,7.1797) || PlayerToPoint(60.0, playerid, -89.3602,-1165.5499,2.3493)
        || PlayerToPoint(60.0, playerid, 1002.8900,-941.1104,42.1797) || PlayerToPoint(60.0, playerid, 1938.6797,-1770.5103,13.3828)
        || PlayerToPoint(60.0, playerid, -1605.5865,-2713.5432,48.5335) || PlayerToPoint(60.0, playerid, 670.6545,1726.7865,7.1875))
    {
        if(dini_Int(file, "Profissao") == Petroleiro)
        {
            if(Carregamento[playerid] == 1)
            {
                SendClientMessage(playerid, Vermelho, "** Seu veнculo nгo estб carregado!");
                return 1;
            }
            else
            {
                Carregamento[playerid] = 1;
                SendClientMessage(playerid, 0x99FFFFAA, "* Seu Veiculo Foi descarregado e Vocк ganhou 100 R$.");
                SetVehicleToRespawn(GetVehicleTrailer(GetPlayerVehicleID(playerid)));
               
                if(PlayerToPoint(60.0, playerid, 610.0511,1700.9008,6.9922))
                {
                    GivePlayerGrana(playerid, 80);
                    return 1;
                }
                else if(PlayerToPoint(60.0, playerid, 69.7854,1219.2927,18.8093))
                {
                    GivePlayerGrana(playerid, 70);
                    return 1;
                }
                else if(PlayerToPoint(60.0, playerid, -1676.2520,413.1227,7.1797))//3
                {
                    GivePlayerGrana(playerid, 920);
                    return 1;
                }
                else if(PlayerToPoint(60.0, playerid, -89.3602,-1165.5499,2.3493))//4
                {
                    GivePlayerGrana(playerid, 500);
                    return 1;
                }
                else if(PlayerToPoint(60.0, playerid, 1002.8900,-941.1104,42.1797))//5
                {
                    GivePlayerGrana(playerid, 850);
                    return 1;
                }
                else if(PlayerToPoint(60.0, playerid, 1938.6797,-1770.5103,13.3828))//6
                {
                    GivePlayerGrana(playerid, 1200);
                    return 1;
                }
                else if(PlayerToPoint(60.0, playerid, -1605.5865,-2713.5432,48.5335))//7
                {
                    GivePlayerGrana(playerid, 1350);
                    return 1;
                }
                else if(PlayerToPoint(60.0, playerid, 670.6545,1726.7865,7.1875))//8
                {
                    GivePlayerGrana(playerid, 900);
                }
                return 1;
            }
        }
        else
        {
            SendClientMessage(playerid, Vermelho, "** Vocк nгo й petroleiro.");
            return 1;
        }
    }
    else
    {
        SendClientMessage(playerid, Vermelho, "** Vocк nгo esta no check de descarga.");
    }
    return 1;
}
Porque se for da outra forma ele recebe a grana mesmo nao estando carregado.......

espero ter ajudado