Persze hogy le ...
PPC_Defines.inc
#define PCV_TruckerMatya 9// nem tudom nálad hogy mint van sorba írd a kövi számot
PPC_Defloads
{\"MIT VISZEL\", false, 23.42, PCV_TruckerMatya, {Rakodás}, {Lerakodás}}, // LoadID load szám ami következik
belemész PPC_Dialog.inc be
vannak ilyenek
Dialog_TruckerSelectJobMethod(playerid, response, listitem)
{
// Setup local variables
new ProductList[50], NumProducts, TotalLoadList[1000];
// Just close the dialog if the player clicked \"Cancel\"
if(!response) return 1;
// Select what to do after the player chose \"Select your own load\" or \"Auto assigned load\"
switch (listitem)
{
case 0: // Let the player choose his own load
{
switch (GetVehicleModel(GetPlayerVehicleID(playerid))) // Check the vehicle-model of the player to decide which loads the player can carry
{
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 VehicleBenson, VehicleYankee: // /Ide pedig mivel akarod vinni jármû pl most ezek vannak
ProductList = Product_GetList(PCV_TruckerMatya, NumProducts); //ide is definesbe
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
}
}
}
// Build the List with product-names
for (new i; i < NumProducts; i++)
format(TotalLoadList, 1000, \"%s%s\\n\", TotalLoadList, ALoads[ProductList][LoadName]);
// Let the player choose a load
ShowPlayerDialog(playerid, DialogTruckerSelectLoad, DIALOG_STYLE_LIST, TXT_TruckerDialogSelectLoad, TotalLoadList, TXT_DialogButtonSelect, TXT_DialogButtonCancel);
}
case 1: Trucker_StartRandomJob(playerid); // Start a random trucker-job
}
return 1;
}
// 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 VehicleBenson, VehicleYankee: //Ide pedig mivel akarod vinni jármû pl most ezek vannak
ProductList = Product_GetList(PCV_TruckerMatya, NumProducts); // ÉS amit a definesbe írtunk azt írjuk ide is
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];
// 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, TXT_TruckerDialogSelectStartLoc, TotalStartLocList, TXT_DialogButtonSelect, TXT_DialogButtonCancel); // Let the player choose a starting location
return 1;
}
PPC_Truckingmission.inc
Trucker_SetRandomJob(playerid)
{
// If the player is the driver of the vehicle (GetPlayerVehicleSeat returns -1 if the player is not in a vehicle)
if (GetPlayerVehicleSeat(playerid) == 0)
{
// Check the vehicle-model of the player to decide which job the player can get
switch (GetVehicleModel(GetPlayerVehicleID(playerid)))
{
case VehicleFlatbed, VehicleDFT30: // Select a random job from the routes that don\'t require a trailer and store the data for the player (Flatbed or DFT-30)
return Trucker_SetRandomJobData(playerid, PCV_TruckerNoTrailer);
case VehicleCementTruck: // Select a random job from the routes for cementtrucks and store the data for the player
return Trucker_SetRandomJobData(playerid, PCV_TruckerCementTruck);
case VehicleBenson, VehicleYankee: // Select a random job from the routes for cementtrucks and store the data for the player
return Trucker_SetRandomJobData(playerid, PCV_TruckerMatya); //ide kell írni ezt amit definesbe egy csomag több jármvel tudol szállítai
case VehicleLineRunner, VehicleTanker, VehicleRoadTrain: // If the player\'s vehicle is a \"LineRunner\", \"Tanker\" or \"RoadTrain\"
{
// Select a job based on the trailer model of the player
switch (GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))))
{
case VehicleTrailerCargo, VehicleTrailerCargo2: // Select a random job from the routes that require a cargo-trailer and store the data for the player
return Trucker_SetRandomJobData(playerid, PCV_TruckerCargoTrailer);
case VehicleTrailerOre: // Select a random job from the routes that require a ore-trailer and store the data for the player
return Trucker_SetRandomJobData(playerid, PCV_TruckerOreTrailer);
case VehicleTrailerFluids: // Select a random job from the routes that require a fluids-trailer and store the data for the player
return Trucker_SetRandomJobData(playerid, PCV_TruckerFluidsTrailer);
}
}
}
}
// If no job could be set correctly, return 0
return 0;
}
utána bele mész PPC_PlayerCommand.inc ott rá keresel /work parancsra vagy /munka parancsa kinek mi van......
if (GetPlayerVehicleSeat(playerid) == 0)
{
switch (GetVehicleModel(GetPlayerVehicleID(playerid)))
{
case VehicleFlatbed, VehicleDFT30, VehicleCementTruck, VehicleBenson, VehicleYankee: // ide vannak felsorolva mivel lehet vinni a fuvart dft stb...........
if (APlayerData[playerid][TruckerLicense] == 1) // Check if the player has acquired a truckers license
ShowPlayerDialog(playerid, DialogTruckerJobMethod, DIALOG_STYLE_LIST, \"{07aced}Válassz fuvart:\", \"{FFFF00}Manuális(te állítod be)\\r\\n{1500ff}Automata választás\", \"Oké\", \"Vissza\");
else
Trucker_StartRandomJob(playerid); // Start a random job
case VehicleLineRunner, VehicleTanker, VehicleRoadTrain: // Player is driving a truck which needs a trailer
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) // Check if there is a trailer attached
if (APlayerData[playerid][TruckerLicense] == 1) // Check if the player has acquired a truckers license
ShowPlayerDialog(playerid, DialogTruckerJobMethod, DIALOG_STYLE_LIST, \"{07aced}Válassz fuvart:\", \"{FFFF00}Manuális(te állítod be)\\r\\n{1500ff}Automata választás\", \"Oké\", \"Vissza\"); //ez itt a menû
else
Trucker_StartRandomJob(playerid); // Start a random job
else
SendClientMessage(playerid, 0xFF0000FF, \"Elõször vegyél fel egy pótkocsit\");
default: SendClientMessage(playerid, 0xFF0000FF, \"Szálj be egy kamionba\");
}
}
else
SendClientMessage(playerid, 0xFF0000FF, \"Szálj be egy kamionba\");
}