I need some help with my trucking FS
#4

The code was really messy. Try now:

pawn Код:
CMD:unloadiron(playerid, params[])
{
    if(GetPlayerScore(playerid) >= -500)
    {
        new vehicleid1 = GetPlayerVehicleID(playerid);
       
        if(IsPlayerInRangeOfPoint(playerid, 7.0, 2334.8611, -2081.3384, 13.5469))
        {
            if(GetVehicleModel(vehicleid1) == 422 || GetVehicleModel(vehicleid1) == 543 || GetVehicleModel(vehicleid1) == 554)
            {
                if(CarInfo[vehicleid1][iron] == 25)
                {
                    CarInfo[vehicleid1][iron] = 0;
                    new cash = random(1000-10000)+1000;
                    GivePlayerMoney(playerid, cash);
                    new string[64];
                    format(string,sizeof(string),"You earned %d from delivery",cash);
                    SendClientMessage(playerid,0xFFFFFFAA,string);
                    return 1;
                }
                else
                    return SendClientMessage(playerid, 0x00000014, "Your truck is empty!");
            }
            else if(GetVehicleModel(vehicleid1) == 440 || GetVehicleModel(vehicleid1) == 609 || GetVehicleModel(vehicleid1) == 414 || GetVehicleModel(vehicleid1) == 456 || GetVehicleModel(vehicleid1) == 482)
            {
                if(CarInfo[vehicleid1][iron] == 50)
                {
                    CarInfo[vehicleid1][iron] = 0;
                    new cash = random(2000-20000)+2000;
                    GivePlayerMoney(playerid, cash);
                    new string[64];
                    format(string,sizeof(string),"You earned %d from delivery",cash);
                    SendClientMessage(playerid,0xFFFFFFAA,string);
                    return 1;
                }
                else
                    return SendClientMessage(playerid, COLOR_ORANGE, "Your truck is empty!");
            }
            else if(GetVehicleModel(vehicleid1) == 403 || GetVehicleModel(vehicleid1) == 515 || GetVehicleModel(vehicleid1) == 455 || GetVehicleModel(vehicleid1) == 514)
            {
                if(CarInfo[vehicleid1][iron] == 100)
                {
                    CarInfo[vehicleid1][iron] = 0;
                    new cash = random(3000-30000)+3000;
                    GivePlayerMoney(playerid, cash);
                    new string[64];
                    format(string,sizeof(string),"You earned %d from delivery",cash);
                    SendClientMessage(playerid,COLOR_ORANGE,string);
                    return 1;
                }
                else
                    return SendClientMessage(playerid, COLOR_ORANGE, "Your truck is empty!");
            }          
            else if(GetVehicleModel(vehicleid1) == 435 || GetVehicleModel(vehicleid1) == 450 || GetVehicleModel(vehicleid1) == 591)
            {
                if(CarInfo[vehicleid1][iron] == 100)
                {
                    CarInfo[vehicleid1][iron] = 0;
                    new cash = random(3000-30000)+3000;
                    GivePlayerMoney(playerid, cash);
                    new string[64];
                    format(string,sizeof(string),"You earned %d from delivery",cash);
                    SendClientMessage(playerid,0xFFFFFFAA,string);
                    return 1;
                }
                else
                    return SendClientMessage(playerid, COLOR_ORANGE, "Your truck is empty!");
            }
            else
                return SendClientMessage(playerid, COLOR_ORANGE, "You are not in a truck!");
        }
        else
            return SendClientMessage(playerid, COLOR_ORANGE, "You are not near the delivery point!");
    }
    else
        return SendClientMessage(playerid, COLOR_ORANGE, "Your job isn't trucker.");
   
    return 1;
}

CMD:loadiron(playerid, params[])
{
    if(GetPlayerScore(playerid) >= -500)
    {
        new vehicleid1 = GetPlayerVehicleID(playerid);
       
        if(IsPlayerInRangeOfPoint(playerid, 7.0, -1969.5801, -2431.8479, 30.6250))
        {
            if(GetVehicleModel(vehicleid1) == 422 || GetVehicleModel(vehicleid1) == 543 || GetVehicleModel(vehicleid1) == 554)
            {
                if(CarInfo[vehicleid1][iron] == 0)
                {
                    CarInfo[vehicleid1][iron] = 25;
                    GivePlayerMoney(playerid, -1000);
                    SendClientMessage(playerid, COLOR_ORANGE, "You loaded full truck of iron, and paid  $1000 for it! Head to unload place");
                }
                else
                    return SendClientMessage(playerid, COLOR_ORANGE, "Your truck is emtpy!");
            }
            else if(GetVehicleModel(vehicleid1) == 440 || GetVehicleModel(vehicleid1) == 609 || GetVehicleModel(vehicleid1) == 414 || GetVehicleModel(vehicleid1) == 456 || GetVehicleModel(vehicleid1) == 482)
            {
                if(CarInfo[vehicleid1][iron] == 0)
                {
                    CarInfo[vehicleid1][iron] = 50;
                    GivePlayerMoney(playerid, -2000);
                    SendClientMessage(playerid, 0x00900082, "You loaded full truck iron, and paid  $2000 for it! Head to unload place");
                }
                else
                    return SendClientMessage(playerid, 0x00000014, "Your truck is emtpy!");
            }
            else if(GetVehicleModel(vehicleid1) == 403 || GetVehicleModel(vehicleid1) == 515 || GetVehicleModel(vehicleid1) == 455 || GetVehicleModel(vehicleid1) == 514)
            {
                if(CarInfo[vehicleid1][iron] == 0)
                {
                    CarInfo[vehicleid1][iron] = 100;
                    GivePlayerMoney(playerid, -3000);
                    SendClientMessage(playerid, 0x00900082, "You loaded full truck of iron, and paid  $3000 for it! Head to unload place");
                }
                else
                    return SendClientMessage(playerid, 0x00000014, "Your truck is full!");
            }
            if(GetVehicleModel(vehicleid1) == 435 || GetVehicleModel(vehicleid1) == 450 || GetVehicleModel(vehicleid1) == 591)
            {
                if(CarInfo[vehicleid1][iron] == 0)
                {
                    CarInfo[vehicleid1][iron] = 100;
                    GivePlayerMoney(playerid, -3000);
                    SendClientMessage(playerid, 0x00900082, "You loaded full trailer iron, and paid  $3000 for it! Head to unload place");
                }
                else
                    return SendClientMessage(playerid, COLOR_ORANGE, "Your truck is already full!");
            }
            else
                return SendClientMessage(playerid, COLOR_ORANGE, "You are not in a iron delivery truck!");
        }
        else
            return SendClientMessage(playerid, COLOR_ORANGE, "You are not near a loading point!");
    }
    else
        return SendClientMessage(playerid, COLOR_ORANGE, "Your job isn't trucker.");

    return 1;
}

CMD:helptruck(playerid, params[])
{
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Small trucks: Bobcat(422), Sadler(543), Yosemite(554)");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Medium trucks: Rumpo(440), Boxville(609), Mule(414), Yankee(456), Burrito(482)");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Big trucks: Linerunner(403), Roadtrain(515), Flatbed(455), Tanker(514)");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Trailers: Article-trailer(435), Article-trailer 2(450), Article-trailer 3(591)");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Small trucks can only carry up to 25 pieces of iron, wicth will cost you 1k.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Medium trucks can only carry up to 50 pieces of iron, wicth will cost you 2k.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Big trucks and trailers can carry up to 50 pieces of iron, wicth will cost you 3k.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Trailers can be taken for free from Flint Country gas station.");
    return 1;
}

CMD:frisktruck(playerid, params[])
{
    new vehicleid1 = GetPlayerVehicleID(playerid);
   
    if(GetPlayerScore(playerid) >= -500)
    {
        if(GetVehicleModel(vehicleid1) == 422 || GetVehicleModel(vehicleid1) == 543 || GetVehicleModel(vehicleid1) == 554)
        {
            if(CarInfo[vehicleid1][iron] == 0)
                SendClientMessage(playerid, 0x00900082, "Iron 0/25");
            else if(CarInfo[vehicleid1][iron] == 25)
                SendClientMessage(playerid, 0x00900082, "Iron 25/25");
        }
        else if(GetVehicleModel(vehicleid1) == 440 || GetVehicleModel(vehicleid1) == 609 || GetVehicleModel(vehicleid1) == 414 || GetVehicleModel(vehicleid1) == 456 || GetVehicleModel(vehicleid1) == 482)
        {
            if(CarInfo[vehicleid1][iron] == 0)
                SendClientMessage(playerid, 0x00900082, "Iron 0/50");
            else if(CarInfo[vehicleid1][iron] == 50)
                SendClientMessage(playerid, 0x00900082, "Iron 50/50");
        }
        else if(GetVehicleModel(vehicleid1) == 403 || GetVehicleModel(vehicleid1) == 515 || GetVehicleModel(vehicleid1) == 455 || GetVehicleModel(vehicleid1) == 514)
        {
            if(CarInfo[vehicleid1][iron] == 0)
                SendClientMessage(playerid, 0x00900082, "Iron 0/100");
            else if(CarInfo[vehicleid1][iron] == 100)
                SendClientMessage(playerid, 0x00900082, "Iron 100/100");
        }
        else if(GetVehicleModel(vehicleid1) == 435 || GetVehicleModel(vehicleid1) == 450 || GetVehicleModel(vehicleid1) == 591)
        {
            if(CarInfo[vehicleid1][iron] == 0)
                SendClientMessage(playerid, 0x00900082, "Iron 0/100");
            if(CarInfo[vehicleid1][iron] == 100)
                SendClientMessage(playerid, 0x00900082, "Iron 100/100");
        }
        else
            return SendClientMessage(playerid, 0x00000014, "You are not near any trucks!");
    }
    else
        return SendClientMessage(playerid, 0x00000014, "You cannot use this command");
       
    return 1;
}
Reply


Messages In This Thread
I need some help with my trucking FS - by Zigonja - 29.05.2013, 17:20
Re: I need some help with my trucking FS - by GiamPy. - 29.05.2013, 21:17
Re: I need some help with my trucking FS - by Zigonja - 29.05.2013, 21:38
Re: I need some help with my trucking FS - by GiamPy. - 29.05.2013, 21:44
Re: I need some help with my trucking FS - by Zigonja - 29.05.2013, 22:09
Re: I need some help with my trucking FS - by Zigonja - 30.05.2013, 12:19
Re: I need some help with my trucking FS - by GiamPy. - 30.05.2013, 12:23
Re: I need some help with my trucking FS - by Zigonja - 30.05.2013, 13:28

Forum Jump:


Users browsing this thread: 2 Guest(s)