Unknown Command [REP+]
#4

pawn Код:
if(strcmp(cmd, "/loadheroin", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pJob] == 16)
            {
                new tmpcar = GetPlayerVehicleID(playerid);
                if(IsPlayerInRangeOfPoint(playerid, 30, -2172.7830,-215.0502,35.3203))
                {
                    if(GetVehicleModel(tmpcar) == 433 || GetVehicleModel(tmpcar) == 440 || GetVehicleModel(tmpcar) == 514 || GetVehicleModel(tmpcar) == 428 || GetVehicleModel(tmpcar) == 403 || GetVehicleModel(tmpcar) == 515)
                    {
                        if(PlayerHaul[tmpcar][pHeroin] < PlayerHaul[tmpcar][pCapasity])
                        {
                            new amount;
                            new compcost = 30;
                            tmp = strtok(cmdtext, idx);
                            if(!strlen(tmp))
                            {
                                SCM(playerid, COLOR_GRAD1, "USAGE: /loadheroin [amount]");
                                return 1;
                            }
                            amount = strval(tmp);
                            if(amount < 1 || amount > 100) { SCM(playerid, COLOR_GREY, "   Can't buy less then 1 gram or more then 100!"); return 1; }
                            new check = PlayerHaul[tmpcar][pHeroin] + amount;
                            if(check > PlayerHaul[tmpcar][pCapasity])
                            {
                                format(string, sizeof(string), "   You went over the Truck heroin Carry Limit of %d, you currently carry %d.",PlayerHaul[tmpcar][pCapasity],PlayerHaul[tmpcar][pHeroin]);
                                SCM(playerid, COLOR_GREY, string);
                                return 1;
                            }
                            new cost = amount*compcost;
                            if(GetPlayerMoney(playerid) >= cost)
                            {
                                PlayerHaul[tmpcar][pHeroin] = amount;
                                format(string, sizeof(string), "Heroin: %d/%d.", PlayerHaul[tmpcar][pHeroin],PlayerHaul[tmpcar][pCapasity]);
                                SCM(playerid, TEAM_GROVE_COLOR, string);
                                format(string, sizeof(string), "You bought %d grams of heroin for $%d. please wait for it to load.", amount,cost);
                                SCM(playerid, TEAM_GROVE_COLOR, string);
                                SafeGivePlayerMoney(playerid,-cost);
                                TogglePlayerControllable(playerid, 0);
                                SetTimer("Unfreezeply", 10000, 0);
                                return 1;
                            }
                            else
                            {
                                format(string, sizeof(string), "You cant afford %d grams Heroin at $%d!", amount,cost);
                                SCM(playerid, TEAM_GROVE_COLOR, string);
                            }
                        }
                        else
                        {
                            format(string, sizeof(string), "Heroin: %d/%d.", PlayerHaul[tmpcar][pHeroin],PlayerHaul[tmpcar][pCapasity]);
                            SCM(playerid, TEAM_GROVE_COLOR, string);
                        }
                    }
                    else
                    {
                        SCM(playerid, TEAM_GROVE_COLOR, "This Vehicle does not deliver Heroin.");
                    }
                }
                else
                {
                    SCM(playerid, COLOR_GREY, "You are not in heroin place.");
                }
            }

        }
        return 1;
    }
Reply


Messages In This Thread
Unknown Command [REP+] - by Don_Cage - 26.12.2013, 00:32
Re: Unknown Command [REP+] - by Loot - 26.12.2013, 01:37
Re: Unknown Command [REP+] - by Don_Cage - 26.12.2013, 01:49
Re: Unknown Command [REP+] - by ToiletDuck - 26.12.2013, 02:09
Re: Unknown Command [REP+] - by Don_Cage - 26.12.2013, 02:21
Re: Unknown Command [REP+] - by ToiletDuck - 26.12.2013, 02:28
Re: Unknown Command [REP+] - by Don_Cage - 26.12.2013, 02:31
Re: Unknown Command [REP+] - by Raisingz - 26.12.2013, 02:58
Re: Unknown Command [REP+] - by Don_Cage - 26.12.2013, 03:01
Re: Unknown Command [REP+] - by Raisingz - 26.12.2013, 03:03

Forum Jump:


Users browsing this thread: 3 Guest(s)