Bugged cmd
#1

The same line comes when I try to use the cmd (Marked it in the script)
pawn Код:
if(strcmp(cmd, "/loadmats", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new tmpcar = GetPlayerVehicleID(playerid);
            new compcost = 30;
            if(IsPlayerInRangeOfPoint(playerid, 20, -2687.8723,1413.9987,7.1016))
            {
                if(IsATruck(tmpcar) || IsATrailer(tmpcar))
                {
                    if(PlayerHaul[tmpcar][pMaterials] < PlayerHaul[tmpcar][pCapasity])
                    {
                        new amount;
                        tmp = strtok(cmdtext, idx);
                        if(!strlen(tmp))
                        {
                            SCM(playerid, COLOR_GRAD1, "USAGE: /loadmats [amount]");
                            return 1;
                        }
                        amount = strval(tmp);
                        if(amount < 1 || amount > 100) { SCM(playerid, COLOR_GREY, "   Can't buy less then 1 material or more then 100!"); return 1; }
                        new check = PlayerHaul[tmpcar][pMaterials] + amount;
                        if(check > PlayerHaul[tmpcar][pCapasity])
                        {
                            format(string, sizeof(string), "   You went over the Truck Carry Limit of %d, you currently carry %d.",PlayerHaul[tmpcar][pCapasity],PlayerHaul[tmpcar][pMaterials]);
                            SCM(playerid, COLOR_GREY, string);
                            return 1;
                        }
                        new cost = amount*compcost;
                        if(GetPlayerMoney(playerid) >= cost)
                        {
                            PlayerHaul[tmpcar][pMaterials] = amount;
                            format(string, sizeof(string), "Materials: %d/%d.", PlayerHaul[tmpcar][pMaterials],PlayerHaul[tmpcar][pCapasity]);
                            SCM(playerid, TEAM_GROVE_COLOR, string);
                            format(string, sizeof(string), "You bought %d materials for $%d.", amount,cost);
                            SCM(playerid, TEAM_GROVE_COLOR, string);
                            SafeGivePlayerMoney(playerid,-cost);
                            return 1;
                        }
                        else
                        {
                            format(string, sizeof(string), "You cant afford %d Materials at $%d!", amount,cost);
                            SCM(playerid, TEAM_GROVE_COLOR, string);
                            return 1;
                        }
                    }
                    else
                    {
                        /*----->*/  SCM(playerid, TEAM_GROVE_COLOR,"A Truck can only carry 1-100, if you want to carry up too 1000 you will need a Trailer.");  //This line comes when I try to use the cmd
                            return 1;
                    }
                }
                else
                {
                    SCM(playerid, TEAM_GROVE_COLOR, "This Vehicle does not deliver materials.");
                    return 1;
                }
            }
            else
            {
                SCM(playerid, COLOR_GREY, "You are not in materials place.");
                return 1;
            }
        }
        return 1;
    }
Reply


Messages In This Thread
Bugged cmd - by Don_Cage - 22.06.2014, 23:24
Re: Bugged cmd - by rappy93 - 22.06.2014, 23:40
Re: Bugged cmd - by Don_Cage - 23.06.2014, 11:24
Re: Bugged cmd - by Don_Cage - 23.06.2014, 19:01
Re: Bugged cmd - by Golf - 23.06.2014, 19:03
Re: Bugged cmd - by Don_Cage - 23.06.2014, 19:12
Re: Bugged cmd - by Golf - 23.06.2014, 19:14
Re: Bugged cmd - by Don_Cage - 23.06.2014, 19:15
Re: Bugged cmd - by Golf - 23.06.2014, 19:18
Re: Bugged cmd - by Don_Cage - 23.06.2014, 19:21

Forum Jump:


Users browsing this thread: 1 Guest(s)