Okay so i got a trucker license wich shows all the jobs in the game now i want to change it so you only get like 3 goods instead of all. But how would i do this? This is my code:
pawn Код:
// Process the selected load and create the startlocation-dialog
Dialog_TruckerSelectLoad(playerid, response, listitem)
{
// Setup local variables
new TotalStartLocList[1000], ProductList[50], NumProducts, ProductID, LocID;
// Just close the dialog if the player clicked "Cancel"
if(!response) return 1;
// First get the list of products again, so we can retrieve the selected load from it
switch (GetVehicleModel(GetPlayerVehicleID(playerid))) // Check the vehicle-model of the player
{
case VehicleFlatbed, VehicleDFT30: // If the player's vehicle is a "Flatbed" or "DFT-30"
ProductList = Product_GetList(PCV_TruckerNoTrailer, NumProducts); // Build a list of products defined for truckers without a trailer
case VehicleCementTruck: // If the player's vehicle is a "CementTruck"
ProductList = Product_GetList(PCV_TruckerCementTruck, NumProducts); // Build a list of products defined for truckers witha cement truck
case VehicleLineRunner, VehicleTanker, VehicleRoadTrain: // If the player's vehicle is a "LineRunner", "Tanker" or "RoadTrain"
{
switch (GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid)))) // Select the loads based on the trailer model of the player
{
case VehicleTrailerCargo, VehicleTrailerCargo2: // A cargo-trailer is attached
ProductList = Product_GetList(PCV_TruckerCargoTrailer, NumProducts); // Build a list of products defined for truckers with a cargo-trailer
case VehicleTrailerOre: // An Ore-trailer is attached
ProductList = Product_GetList(PCV_TruckerOreTrailer, NumProducts); // Build a list of products defined for truckers with an ore-trailer
case VehicleTrailerFluids: // A fluids-trailer is attached
ProductList = Product_GetList(PCV_TruckerFluidsTrailer, NumProducts); // Build a list of products defined for truckers with a fluids-trailer
}
}
}
// Store the selected LoadID in the player's account
APlayerData[playerid][LoadID] = ProductList[listitem];
ProductID = APlayerData[playerid][LoadID];
// Build a list of start-locations for this product
for (new i; i < 30; i++)
{
// Get the location-id
LocID = ALoads[ProductID][FromLocations][i];
// Check if it a valid location-id (not 0)
if (LocID != 0)
format(TotalStartLocList, 1000, "%s%s\n", TotalStartLocList, ALocations[LocID][LocationName]); // Add the location-name to the list
else
break; // As soon as an invalid location-id has been found, stop adding entries to the location-list
}
// Ask the player to choose a start-location
ShowPlayerDialog(playerid, DialogTruckerStartLoc, DIALOG_STYLE_LIST, "Select loading point:", TotalStartLocList, "Select", "Cancel"); // Let the player choose a starting location
return 1;
}