24.05.2015, 16:11
Just use else statement:
PHP код:
COMMAND:cargo(playerid,params[])
{
if(pInfo[playerid][pCargo] == 1) return SendClientMessage(playerid, RED, "Already Delivering Cargo!");
if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 519) return SendClientMessage(playerid, RED,"You Must be in a Shamal to Start this Job!");
if(IsPlayerInRangeOfPoint(playerid, 500.0, 1761.4497,-2494.3818,13.5547)) // LS LOC
{
pInfo[playerid][pCargo] = 1;
pInfo[playerid][pCargoM] = 0;
pInfo[playerid][pCargoD] = 3;
TextDrawShowForPlayer(playerid, CargoTD);
TextDrawShowForPlayer(playerid, CargoLoc[playerid]);
SendClientMessage(playerid, YELLOW, "Cargo Delivery: Load and Deliver Cargo to and from Airports all around San Andreas!");
Streamer_AppendArrayData(STREAMER_TYPE_CP, Checkpoint[193], E_STREAMER_PLAYER_ID, playerid);
new str[48];
format(str,sizeof(str),"~b~~h~Location: ~g~Los Santos Airport");
TextDrawSetString(CargoLoc[playerid], str);
SendClientMessage(playerid, YELLOW, "Load Cargo from Los Santos Airport for Delivery!");
}
else if(IsPlayerInRangeOfPoint(playerid, 500.0, -1397.5881,-284.6473,26.2160)) // SF LOC
{
pInfo[playerid][pCargo] = 1;
pInfo[playerid][pCargoM] = 0;
pInfo[playerid][pCargoD] = 3;
TextDrawShowForPlayer(playerid, CargoTD);
TextDrawShowForPlayer(playerid, CargoLoc[playerid]);
SendClientMessage(playerid, YELLOW, "Cargo Delivery: Load and Deliver Cargo to and from Airports all around San Andreas!");
Streamer_AppendArrayData(STREAMER_TYPE_CP, Checkpoint[194], E_STREAMER_PLAYER_ID, playerid);
new str[48];
format(str,sizeof(str),"~b~~h~Location: ~g~San Fierro Airport");
TextDrawSetString(CargoLoc[playerid], str);
SendClientMessage(playerid, YELLOW, "Load Cargo from San Fierro Airport for Delivery!");
}
else if(IsPlayerInRangeOfPoint(playerid, 500.0, 1473.1907,1507.4999,10.8203)) // LV LOC
{
pInfo[playerid][pCargo] = 1;
pInfo[playerid][pCargoM] = 0;
pInfo[playerid][pCargoD] = 3;
TextDrawShowForPlayer(playerid, CargoTD);
TextDrawShowForPlayer(playerid, CargoLoc[playerid]);
SendClientMessage(playerid, YELLOW, "Cargo Delivery: Load and Deliver Cargo to and from Airports all around San Andreas!");
Streamer_AppendArrayData(STREAMER_TYPE_CP, Checkpoint[195], E_STREAMER_PLAYER_ID, playerid);
new str[48];
format(str,sizeof(str),"~b~~h~Location: ~g~Las Venturas Airport");
TextDrawSetString(CargoLoc[playerid], str);
SendClientMessage(playerid, YELLOW, "Load Cargo from Las Venturas Airport for Delivery!");
}
else if(IsPlayerInRangeOfPoint(playerid, 500.0, 164.0293,2494.4155,16.4844)) // ABAND LOC
{
pInfo[playerid][pCargo] = 1;
pInfo[playerid][pCargoM] = 0;
pInfo[playerid][pCargoD] = 3;
TextDrawShowForPlayer(playerid, CargoTD);
TextDrawShowForPlayer(playerid, CargoLoc[playerid]);
SendClientMessage(playerid, YELLOW, "Cargo Delivery: Load and Deliver Cargo to and from Airports all around San Andreas!");
Streamer_AppendArrayData(STREAMER_TYPE_CP, Checkpoint[196], E_STREAMER_PLAYER_ID, playerid);
new str[48];
format(str,sizeof(str),"~b~~h~Location: ~g~Abandoned Airport");
TextDrawSetString(CargoLoc[playerid], str);
SendClientMessage(playerid, YELLOW, "Load Cargo from Abandoned Airport for Delivery!");
}
else SendClientMessage(playerid, RED, "You can only start a Cargo Mission at an Airport!");
return 1;
}