COMMAND:deliver(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 433)
{
if(enrep[playerid] == 0 && enload[playerid] == 0)
{
if(ccargado[playerid] == 1)
{
new lugdent = random(12);
enrep[playerid] = 1;
switch (lugdent)
{
case 0:
{
SetPlayerCheckpoint(playerid,2338.7712,32.0935,26.4844,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery of magazines to jazz magazines");
}
case 1:
{
SetPlayerCheckpoint(playerid,2338.8330,-44.6022,26.4844,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery with products to Raimi Realty");
}
case 2:
{
SetPlayerCheckpoint(playerid,2339.0125,-67.0500,26.3359,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery of hardware to Bubґs");
}
case 3:
{
SetPlayerCheckpoint(playerid,2314.4478,-93.3005,26.4844,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery to the General Store");
}
case 4:
{
SetPlayerCheckpoint(playerid,2299.0232,-70.7920,26.4844,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery of books to the DMV School");
}
case 5:
{
SetPlayerCheckpoint(playerid,2298.9321,-10.3696,26.4844,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery of bankchecks to the bank");
}
case 6:
{
SetPlayerCheckpoint(playerid,2276.4290,46.8699,26.4844,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery of alcohol to the bar");
}
case 7:
{
SetPlayerCheckpoint(playerid,1231.3864,192.6526,19.5547,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery of car parts to Palomino Roadhunters");
}
case 8:
{
SetPlayerCheckpoint(playerid,844.5975,-599.1318,18.4219,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery of car parts to Palomino Street Cruisers");
}
case 9:
{
SetPlayerCheckpoint(playerid,2362.4163,240.6807,26.6089,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery of tools and spareparts to the mechanic garage");
}
case 10:
{
SetPlayerCheckpoint(playerid,1394.3412,376.3297,19.7703,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery of tires to the Derby arena");
}
case 11:
{
SetPlayerCheckpoint(playerid,2270.4766,-84.9801,26.5111,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a deliver of materials to the Palomino PDP");
}
case 12:
{
SetPlayerCheckpoint(playerid,1334.6967,286.4982,19.5615,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a deliver of soft drinks to the Sprunk Factory");
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Load your truck first, type /loadtruck to load it!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Your mission is cancelled!");
DisablePlayerCheckpoint(playerid);
enrep[playerid] = 0;
enload[playerid] = 0;
ccargado[playerid] = 0;
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You have to be the driver!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You have to be in a delivery truck!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You have to be in a Truck!");
return 1;
}
return 1;
}
COMMAND:deliver(playerid, params[])
{
if(IsPlayerInAnyVehicle(playerid))
{
if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 433)
{
if(enrep[playerid] == 0 && enload[playerid] == 0)
{
if(ccargado[playerid] == 1)
{
new lugdent;
if(GetPlayerTeam(playerid) == 0) lugdent = random(3);
else if(GetPlayerTeam(playerid) == 1) lugdent = 2+random(3);
else if(GetPlayerTeam(playerid) == 2) lugdent = 5+random(3);
else if(GetPlayerTeam(playerid) == 3) lugdent = 8+random(3);
enrep[playerid] = 1;
switch (lugdent)
{
case 1:
{
SetPlayerCheckpoint(playerid,2338.7712,32.0935,26.4844,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery of magazines to jazz magazines");
}
case 2:
{
SetPlayerCheckpoint(playerid,2338.8330,-44.6022,26.4844,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery with products to Raimi Realty");
}
case 3:
{
SetPlayerCheckpoint(playerid,2339.0125,-67.0500,26.3359,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery of hardware to Bubґs");
}
case 4:
{
SetPlayerCheckpoint(playerid,2314.4478,-93.3005,26.4844,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery to the General Store");
}
case 5:
{
SetPlayerCheckpoint(playerid,2299.0232,-70.7920,26.4844,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery of books to the DMV School");
}
case 6:
{
SetPlayerCheckpoint(playerid,2298.9321,-10.3696,26.4844,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery of bankchecks to the bank");
}
case 7:
{
SetPlayerCheckpoint(playerid,2276.4290,46.8699,26.4844,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery of alcohol to the bar");
}
case 8:
{
SetPlayerCheckpoint(playerid,1231.3864,192.6526,19.5547,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery of car parts to Palomino Roadhunters");
}
case 9:
{
SetPlayerCheckpoint(playerid,844.5975,-599.1318,18.4219,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery of car parts to Palomino Street Cruisers");
}
case 10:
{
SetPlayerCheckpoint(playerid,2362.4163,240.6807,26.6089,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery of tools and spareparts to the mechanic garage");
}
case 11:
{
SetPlayerCheckpoint(playerid,1394.3412,376.3297,19.7703,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery of tires to the Derby arena");
}
case 12:
{
SetPlayerCheckpoint(playerid,2270.4766,-84.9801,26.5111,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a deliver of materials to the Palomino PDP");
}
default: return 1;
}
}
else return SendClientMessage(playerid, COLOR_RED, "Load your truck first, type /loadtruck to load it!");
}
else
{
SendClientMessage(playerid, COLOR_RED, "Your mission is cancelled!");
DisablePlayerCheckpoint(playerid);
enrep[playerid] = 0;
enload[playerid] = 0;
ccargado[playerid] = 0;
return 1;
}
}
else return SendClientMessage(playerid, COLOR_RED, "You have to be the driver!");
}
else return SendClientMessage(playerid, COLOR_RED, "You have to be in a delivery truck!");
}
new team1coords[3];
team1coords[3]
{
Coordinate1,
Coordinate2,
Coordinate3,
}
new team2coords[3]
team2coords[3];
{
Coordinate1,
Coordinate2,
Coordinate3,
}
new team3coords[3];
team3coords[3]
{
Coordinate1,
Coordinate2,
Coordinate3,
}
new team4coords[3];
team4coords[3]
{
Coordinate1,
Coordinate2,
Coordinate3,
}
pawn Code:
|
warning 209: function "cmd_deliver" should return a value
COMMAND:deliver(playerid, params[])
{
if(IsPlayerInAnyVehicle(playerid))
{
if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 433)
{
if(enrep[playerid] == 0 && enload[playerid] == 0)
{
if(ccargado[playerid] == 1)
{
new lugdent;
if(GetPlayerTeam(playerid) == 0) lugdent = random(3);
else if(GetPlayerTeam(playerid) == 1) lugdent = 2+random(3);
else if(GetPlayerTeam(playerid) == 2) lugdent = 5+random(3);
else if(GetPlayerTeam(playerid) == 3) lugdent = 8+random(3);
enrep[playerid] = 1;
switch (lugdent)
{
case 1:
{
SetPlayerCheckpoint(playerid,2338.7712,32.0935,26.4844,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery of magazines to jazz magazines");
}
case 2:
{
SetPlayerCheckpoint(playerid,2338.8330,-44.6022,26.4844,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery with products to Raimi Realty");
}
case 3:
{
SetPlayerCheckpoint(playerid,2339.0125,-67.0500,26.3359,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery of hardware to Bubґs");
}
case 4:
{
SetPlayerCheckpoint(playerid,2314.4478,-93.3005,26.4844,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery to the General Store");
}
case 5:
{
SetPlayerCheckpoint(playerid,2299.0232,-70.7920,26.4844,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery of books to the DMV School");
}
case 6:
{
SetPlayerCheckpoint(playerid,2298.9321,-10.3696,26.4844,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery of bankchecks to the bank");
}
case 7:
{
SetPlayerCheckpoint(playerid,2276.4290,46.8699,26.4844,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery of alcohol to the bar");
}
case 8:
{
SetPlayerCheckpoint(playerid,1231.3864,192.6526,19.5547,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery of car parts to Palomino Roadhunters");
}
case 9:
{
SetPlayerCheckpoint(playerid,844.5975,-599.1318,18.4219,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery of car parts to Palomino Street Cruisers");
}
case 10:
{
SetPlayerCheckpoint(playerid,2362.4163,240.6807,26.6089,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery of tools and spareparts to the mechanic garage");
}
case 11:
{
SetPlayerCheckpoint(playerid,1394.3412,376.3297,19.7703,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a delivery of tires to the Derby arena");
}
case 12:
{
SetPlayerCheckpoint(playerid,2270.4766,-84.9801,26.5111,4);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have a deliver of materials to the Palomino PDP");
}
default: return 1;
}
}
else return SendClientMessage(playerid, COLOR_RED, "Load your truck first, type /loadtruck to load it!");
}
else
{
SendClientMessage(playerid, COLOR_RED, "Your mission is cancelled!");
DisablePlayerCheckpoint(playerid);
enrep[playerid] = 0;
enload[playerid] = 0;
ccargado[playerid] = 0;
return 1;
}
}
else return SendClientMessage(playerid, COLOR_RED, "You have to be the driver!");
}
else return SendClientMessage(playerid, COLOR_RED, "You have to be in a delivery truck!");
return 1;
}
#define MAX_DELOCATIONS 12
enum DELIVER_INFO{Float:deX,Float:deY,Float:deZ,deTeam}
new gDeliverCoords[MAX_DELOCATIONS][DELIVER_INFO];
GetDeliverId(playerid)
{
new deid,playerteam;
playerteam=GetPlayerTeam(playerid);
do deid=random(MAX_DELOCATIONS);
while (gDeliverCoords[deid][deTeam]!=playerteam);
return deid;
}
I think something like this would be more suited:
pawn Code:
|
gDeliverCoords
do deid
deTeam