14.11.2011, 10:28
Hello!
im trying to convert and change my old delivery code.
There is 12 coords that i want to split up on 4 teams on this cmd, the coords should be random selected as this code does right now, but only from 3 specific coords for each team (hope you understand what i mean)
case 0-2 is for GetPlayerTeam(playerid) == 0)
case 3-5 is for GetPlayerTeam(playerid) == 1)
case 6-8 is for GetPlayerTeam(playerid) == 2)
case 9-11 is for GetPlayerTeam(playerid) == 3)
the 12th case can be removed.
I have no idea how to split this up, the players for now gets one of all these coords randomly, the point is to only get 1 of 3 of the teams specific coords. And im sure the code can be made mush better.
im trying to convert and change my old delivery code.
There is 12 coords that i want to split up on 4 teams on this cmd, the coords should be random selected as this code does right now, but only from 3 specific coords for each team (hope you understand what i mean)
case 0-2 is for GetPlayerTeam(playerid) == 0)
case 3-5 is for GetPlayerTeam(playerid) == 1)
case 6-8 is for GetPlayerTeam(playerid) == 2)
case 9-11 is for GetPlayerTeam(playerid) == 3)
the 12th case can be removed.
I have no idea how to split this up, the players for now gets one of all these coords randomly, the point is to only get 1 of 3 of the teams specific coords. And im sure the code can be made mush better.
pawn Code:
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;
}