[Ajuda] Viniborn
#2

Tenta assim.
pawn Код:
if(strcmp(cmd, "/comprarprods", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new vId = GetPlayerVehicleID(playerid);
            new tmpcar = GetPlayerVehicleID(playerid);
            new compcost = 50;
            if(PlayerToPoint(60.0, playerid, 1750.9022,-2054.1663,14.1010))
            {
                if(vId <= Produtos[0] && vId >= Produtos[3]){
                    if(PlayerHaul[tmpcar][pLoad] < PlayerHaul[tmpcar][pCapasity])
                    {
                        new amount;
                        tmp = strtok(cmdtext, idx);
                        if(!strlen(tmp))
                        {
                            SendClientMessage(playerid, COLOR_GRAD1, "USO: /comprarprods [quantia]");
                            return 1;
                        }
                        amount = strval(tmp);
                        if(amount < 1 || amount > 500) { SendClientMessage(playerid, COLOR_GREY, "   Can't buy less then 1 Product ou more then 500 !"); return 1; }
                        new check= PlayerHaul[tmpcar][pLoad] + amount;
                        if(check > PlayerHaul[tmpcar][pCapasity])
                        {
                            format(string, sizeof(string), "   Vocк ultrapassou o limite de produtos %d, seus carregamentos %d",PlayerHaul[tmpcar][pCapasity],PlayerHaul[tmpcar][pLoad]);
                            SendClientMessage(playerid, COLOR_GREY, string);
                            return 1;
                        }
                        new cost = amount*compcost;
                        if(GetPlayerGP(playerid) >= cost)
                        {
                            PlayerHaul[tmpcar][pLoad] += amount;
                            format(string, sizeof(string), "Produtos: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
                            SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
                            format(string, sizeof(string), "Vocк comprou %d por R$ %d", amount,cost);
                            SendClientMessage(playerid, COLOR_WHITE, string);
                            GivePlayerGP(playerid,-cost);
                            PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                            return 1;
                        }
                        else
                        {
                            format(string, sizeof(string), "    Vocк nгo pфde pagar os produtos por R$ %d !", amount,cost);
                            SendClientMessage(playerid, COLOR_GREY, string);
                            return 1;
                        }
                    }
                    else
                    {
                            format(string, sizeof(string), "Produtos: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
                            SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
                            return 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "    Esse veнculo nгo faz entrega de produtos");
                    return 1;
                }
            }
        }
        return 1;
    }
Reply


Messages In This Thread
[Ajuda] Viniborn - by Sr.Pekeno - 13.08.2011, 23:43
Re: [Ajuda] Viniborn - by Dolby - 13.08.2011, 23:51
Re: [Ajuda] Viniborn - by Sr.Pekeno - 13.08.2011, 23:53
Re: [Ajuda] Viniborn - by Ricop522 - 13.08.2011, 23:53
Re: [Ajuda] Viniborn - by Sr.Pekeno - 13.08.2011, 23:55
Re: [Ajuda] Viniborn - by Bruno Pereira - 13.08.2011, 23:59
Re: [Ajuda] Viniborn - by Sr.Pekeno - 14.08.2011, 00:02
Re: [Ajuda] Viniborn - by ViniBorn - 14.08.2011, 00:03
Re: [Ajuda] Viniborn - by Sr.Pekeno - 14.08.2011, 00:06
Re: [Ajuda] Viniborn - by ViniBorn - 14.08.2011, 00:09

Forum Jump:


Users browsing this thread: 1 Guest(s)