new FedexJob[MAX_PLAYERS]; new FedexStep[MAX_PLAYERS];
DrivingStep[playerid] = 0; FedexJob[playerid] = 0;
CMD:loadmail(playerid, params[]) { FedexJob[playerid] = 1; FedexStep[playerid] = 1; SetPlayerCheckpoint(playerid,1965.1832,-1992.3107,13.4766,5); return 1; }
if(IsFedexVehicle(playerid)) { if(FedexJob[playerid] == 1) // Fedex Route { if(IsPlayerInRangeOfPoint(playerid,5,1965.1832,-1992.3107,13.4766)) // Checkpoint 1 { FedexStep[playerid] = 2; SetPlayerCheckpoint(playerid,1932.7761,-1777.1222,13.1099,5); } else if(IsPlayerInRangeOfPoint(playerid,5,1932.7761,-1777.1222,13.1099)) // Checkpoint 2 { FedexStep[playerid] = 3; SetPlayerCheckpoint(playerid,2095.7678,-1799.1807,13.1115,5); } else if(IsPlayerInRangeOfPoint(playerid,5,2095.7678,-1799.1807,13.1115)) // Checkpoint 3 { FedexStep[playerid] = 4; SetPlayerCheckpoint(playerid,2245.0481,-1659.6323,15.0141,5); } else if(IsPlayerInRangeOfPoint(playerid,5,2245.0481,-1659.6323,15.0141)) // Checkpoint 4 { FedexStep[playerid] = 5; SetPlayerCheckpoint(playerid,1696.4751,-1505.9568,13.1099,5); } else if(IsPlayerInRangeOfPoint(playerid,5,1696.4751,-1505.9568,13.1099)) // Checkpoint 5 { FedexStep[playerid] = 6; SetPlayerCheckpoint(playerid,1533.3690,-1658.0847,13.1099,5); } else if(IsPlayerInRangeOfPoint(playerid,5,1533.3690,-1658.0847,13.1099)) // Checkpoint 6 { FedexStep[playerid] = 7; SetPlayerCheckpoint(playerid,1325.7488,-1568.8619,13.0892,5); } else if(IsPlayerInRangeOfPoint(playerid,5,1325.7488,-1568.8619,13.0892)) // Checkpoint 7 { FedexStep[playerid] = 8; SetPlayerCheckpoint(playerid,1227.0610,-1826.7629,13.1372,5); } else if(IsPlayerInRangeOfPoint(playerid,5,1227.0610,-1826.7629,13.1372)) // Checkpoint 8 { FedexStep[playerid] = 9; SetPlayerCheckpoint(playerid,1357.6099,-1754.7562,13.0843,5); } else if(IsPlayerInRangeOfPoint(playerid,5,1357.6099,-1754.7562,13.0843)) // Checkpoint 9 { FedexStep[playerid] = 10; SetPlayerCheckpoint(playerid,1734.1602,-1736.1362,13.1144,5); } else if(IsPlayerInRangeOfPoint(playerid,5,1734.1602,-1736.1362,13.1144)) // Checkpoint 10 { FedexStep[playerid] = 11; SetPlayerCheckpoint(playerid,1772.5981,-1736.2996,13.1099,5); } else if(IsPlayerInRangeOfPoint(playerid,5,1772.5981,-1736.2996,13.1099)) // Checkpoint 11 { FedexStep[playerid] = 12; SetPlayerCheckpoint(playerid,1958.0129,-1980.9946,13.1177,5); } else if(IsPlayerInRangeOfPoint(playerid,5,1958.0129,-1980.9946,13.1177)) // Checkpoint 12 { FedexStep[playerid] = 13; SetPlayerCheckpoint(playerid,1787.9861,-2059.3037,13.3097,5); } else if(IsPlayerInRangeOfPoint(playerid,5,1787.9861,-2059.3037,13.3097)) // Checkpoint DONE { FedexJob[playerid] = 0; FedexStep[playerid] = 0; GiveDodMoney(playerid, 5000); SendClientMessage(playerid, COLOR_LIGHTGREEN, "Thank you for delivering mails for the businesses. Job is done. Heres Your Paycheck, {FF6347}5000${FFFFFF}."); } } }// FEDEX END
if(FedexJob[playerid] == 1) // Fedex Route
if(FedexJob[playerid] >= 1) // Fedex Route
Replace
pawn Код:
pawn Код:
|
if(FedexJob[playerid] >= 1) // Fedex Route
if(IsPlayerInRangeOfPoint(playerid,5,1965.1832,-1992.3107,13.4766)) // Checkpoint 1
if(IsPlayerInRangeOfPoint(playerid,1965.1832,-1992.3107,13.4766,5)) // Checkpoint 1
Where is that function, IsFedexVehicle placed?
Which callback? |
#define FEDEX_STEP_1
CPIndex[playerid] = FEDEX_STEP_1
OnPlayerEnterCheckPoint(playerid)
{
switch(CPIndex[playerid])
{
case FEDEX_STEP_1: { }
case FEDEX_STEP_2: { }
case FEDEX_STEP_3: { }
case FEDEX_STEP_4: { }
case FEDEX_STEP_5: { }
case FEDEX_STEP_6: { }
}
}