problems with job (+Rep for helpers)
#6

Hello, what about trying a new approach?

Using "switch" instead of "if" (in case you dont know https://sampwiki.blast.hk/wiki/Control_Structures#switch_2)

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
     if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
     {
        switch(PizzaJob[playerid])
        {
            case 1: {
                PizzaJob[playerid]++;
                SetPlayerCheckpoint(playerid,2012.4771,-1640.1229,13.1431,10);
                SendClientMessage(playerid,COLOR_YELLOW,"* Please go to the next mark, and you'll be payed!");
            }
            case 2: {
                PizzaJob[playerid]++;
                SetPlayerCheckpoint(playerid,2387.0063,-1667.1498,13.1249,10);
            }
            case 3: {
                PizzaJob[playerid]++;
                SetPlayerCheckpoint(playerid,2414.9255,-1649.6678,13.1305,10);
            }
            case 4: {
                PizzaJob[playerid]++;
                SetPlayerCheckpoint(playerid,2517.6394,-1678.3141,13.9862,10);
            }
            case 5: {
                PizzaJob[playerid]++;
                SetPlayerCheckpoint(playerid,2441.1526,-2017.4093,13.1231,10);
            }
            case 6: {
                PizzaJob[playerid]++;
                SetPlayerCheckpoint(playerid,2486.2058,-2017.6384,13.1309,10);
            }
            case 7: {
                PizzaJob[playerid]++;
                SetPlayerCheckpoint(playerid,2520.9238,-2016.4714,13.1395,10);
            }
            case 8: {
                PizzaJob[playerid]++;
                SetPlayerCheckpoint(playerid,2464.7258,-2000.3944,13.1430,10);
            }
            case 9: {
                PizzaJob[playerid]++;
                SetPlayerCheckpoint(playerid,2240.8374,-1886.9504,13.1486,10);
            }
            case 10: {
                PizzaJob[playerid]++;
                SetPlayerCheckpoint(playerid,2095.5488,-1815.7517,12.9792,10);
            }
            case 11: {
                PizzaJob[playerid] = 0;
                DisablePlayerCheckpoint(playerid);
                SendClientMessage(playerid,COLOR_YELLOW,"* You have recieved $400 for delivering the pizzas.");
                GivePlayerMoney(playerid,400);
            }
        }
     }
     return 1;
}
EDIT: forgot to disable the last CheckPoint
Reply


Messages In This Thread
problems with job (+Rep for helpers) - by HelpYou - 13.03.2014, 16:41
Re: problems with job (+Rep for helpers) - by Matess - 13.03.2014, 16:45
Re: problems with job (+Rep for helpers) - by HelpYou - 13.03.2014, 16:49
Re: problems with job (+Rep for helpers) - by HelpYou - 13.03.2014, 16:52
Re: problems with job (+Rep for helpers) - by HelpYou - 13.03.2014, 17:07
Re: problems with job (+Rep for helpers) - by Ruben_Alonso - 13.03.2014, 17:08
Re: problems with job (+Rep for helpers) - by Mattakil - 13.03.2014, 17:14
Re: problems with job (+Rep for helpers) - by Matess - 13.03.2014, 17:17
Re: problems with job (+Rep for helpers) - by HelpYou - 13.03.2014, 17:32
Re: problems with job (+Rep for helpers) - by Mattakil - 13.03.2014, 17:33

Forum Jump:


Users browsing this thread: 1 Guest(s)