13.03.2014, 17:08
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)
EDIT: forgot to disable the last CheckPoint
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;
}