1
0

PPC_DefLoads.inc 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. // Setup a custom type that holds all data about a load
  2. enum TLoad
  3. {
  4. LoadName[50], // The name of the load
  5. bool:Mafia, // Holds "true" if this load is wanted by the mafia
  6. Float:PayPerUnit, // Holds the price for every meter to haul this type of load (this gets multiplied by the distance to calculate the payment)
  7. PCV_Required, // This holds the vehicle-type the player needs to use this load (and automatically the player's class)
  8. FromLocations[30], // This array holds all loading-points for this load
  9. ToLocations[30] // This array holds all unloading-points for this load
  10. }
  11. new ALoads[][TLoad] =
  12. {
  13. // LoadName, MafiaLoad, PayPerUnit, VehicleNeeded, From-Locations, To-Locations
  14. // Dummy Load (never used)
  15. {"Dummy", false, 0.00, 0, {0}, {0}}, // LoadID 0
  16. // Loads for ore trailer
  17. {"Gravel", false, 1.00, PCV_TruckerOreTrailer, {11}, {1, 2, 3}}, // LoadID 1
  18. {"Sand", false, 1.00, PCV_TruckerOreTrailer, {12}, {1, 2, 3, 4, 5}}, // LoadID 2
  19. {"Rocks", false, 1.00, PCV_TruckerOreTrailer, {11}, {1, 2, 3, 4, 5}}, // LoadID 3
  20. {"Coal", false, 1.00, PCV_TruckerOreTrailer, {12}, {6, 7, 8}}, // LoadID 4
  21. {"Ore", false, 1.00, PCV_TruckerOreTrailer, {12}, {6, 9}}, // LoadID 5
  22. {"Logs", false, 1.00, PCV_TruckerOreTrailer, {13}, {7, 10}}, // LoadID 6
  23. {"Woodchips", false, 1.00, PCV_TruckerOreTrailer, {10}, {14}}, // LoadID 7
  24. {"Dry Waste", false, 1.00, PCV_TruckerOreTrailer, {6, 15, 16}, {17, 18, 19}}, // LoadID 8
  25. {"Debris", false, 1.00, PCV_TruckerOreTrailer, {17, 19}, {6, 18, 20}}, // LoadID 9
  26. {"Wheat", false, 1.00, PCV_TruckerOreTrailer, {21, 22}, {18, 23, 24}}, // LoadID 10
  27. // Loads for liquids trailer
  28. {"Unleaded Fuel", true, 1.00, PCV_TruckerFluidsTrailer, {8, 25, 26}, {27, 28, 29, 30, 31, 32, 33, 34}}, // LoadID 11
  29. {"Diesel Fuel", true, 1.00, PCV_TruckerFluidsTrailer, {8, 25, 26}, {27, 28, 29, 30, 31, 32, 33, 34}}, // LoadID 12
  30. {"Aviation Fuel", true, 1.00, PCV_TruckerFluidsTrailer, {8, 25, 26}, {35, 36}}, // LoadID 13
  31. {"Crude Oil", false, 1.00, PCV_TruckerFluidsTrailer, {8, 25, 26}, {6}}, // LoadID 14
  32. {"Liquid Nitrogen", false, 1.00, PCV_TruckerFluidsTrailer, {37, 38}, {39, 40}}, // LoadID 15
  33. {"Chemicals", false, 1.00, PCV_TruckerFluidsTrailer, {37}, {6, 15, 39, 40}}, // LoadID 16
  34. {"Pure Water", false, 1.00, PCV_TruckerFluidsTrailer, {37}, {15, 40, 41}}, // LoadID 17
  35. {"Grease", false, 1.00, PCV_TruckerFluidsTrailer, {8, 25}, {6, 10, 14, 42}}, // LoadID 18
  36. {"Fertilizer", false, 1.00, PCV_TruckerFluidsTrailer, {37, 38}, {21, 22}}, // LoadID 19
  37. {"Milk", false, 1.00, PCV_TruckerFluidsTrailer, {21, 22}, {43, 44, 45}}, // LoadID 20
  38. {"Beer", true, 1.00, PCV_TruckerFluidsTrailer, {41}, {44, 46}}, // LoadID 21
  39. {"Ethanol", false, 1.00, PCV_TruckerFluidsTrailer, {37, 41}, {26, 39, 40}}, // LoadID 22
  40. // Loads for cargo trailer
  41. {"Food", false, 1.00, PCV_TruckerCargoTrailer, {7, 44, 47, 48}, {49, 50, 51, 52, 53}}, // LoadID 23
  42. {"Drinks", false, 1.00, PCV_TruckerCargoTrailer, {15, 54, 55}, {49, 50, 51, 52, 53}}, // LoadID 24
  43. {"Bottled Beer", true, 1.00, PCV_TruckerCargoTrailer, {56}, {57, 58, 59, 60, 61}}, // LoadID 25
  44. {"Luxury Goods", false, 1.00, PCV_TruckerCargoTrailer, {24, 55}, {47, 48, 50}}, // LoadID 26
  45. {"Electronics", true, 1.00, PCV_TruckerCargoTrailer, {7, 24, 48}, {50, 51, 62, 63}}, // LoadID 27
  46. {"Sport Equipment", false, 1.00, PCV_TruckerCargoTrailer, {47, 48}, {50, 53, 57}}, // LoadID 28
  47. {"Boards", false, 1.00, PCV_TruckerCargoTrailer, {10}, {4, 7, 18, 22}}, // LoadID 29
  48. {"Building Materials", false, 1.00, PCV_TruckerCargoTrailer, {4}, {1, 2, 3, 5}}, // LoadID 30
  49. {"LiveStock", false, 1.00, PCV_TruckerCargoTrailer, {21, 22}, {23, 43, 47}}, // LoadID 31
  50. {"Meat", false, 1.00, PCV_TruckerCargoTrailer, {43}, {44, 49, 50, 51, 52, 53}}, // LoadID 32
  51. {"Paper", false, 1.00, PCV_TruckerCargoTrailer, {14}, {9, 62}}, // LoadID 33
  52. // Loads for cement truck
  53. {"Cement", false, 1.00, PCV_TruckerCementTruck, {12}, {1, 2, 3, 4}}, // LoadID 34
  54. // Loads for truckers without trailer
  55. {"Food", false, 0.60, PCV_TruckerNoTrailer, {7, 44, 47, 48}, {49, 50, 51, 52, 53}}, // LoadID 35
  56. {"Drinks", false, 0.60, PCV_TruckerNoTrailer, {15, 54, 55}, {49, 50, 51, 52, 53}}, // LoadID 36
  57. {"Bottled Beer", true, 0.60, PCV_TruckerNoTrailer, {56}, {57, 58, 59, 60, 61}}, // LoadID 37
  58. {"Luxury Goods", false, 0.60, PCV_TruckerNoTrailer, {24, 55}, {47, 48, 50}}, // LoadID 38
  59. {"Electronics", true, 0.60, PCV_TruckerNoTrailer, {7, 24, 48}, {50, 51, 62, 63}}, // LoadID 39
  60. {"Sport Equipment", false, 0.60, PCV_TruckerNoTrailer, {47, 48}, {50, 53, 57}}, // LoadID 40
  61. {"Boards", false, 0.60, PCV_TruckerNoTrailer, {10}, {4, 7, 18, 22}}, // LoadID 41
  62. {"Building Materials", false, 0.60, PCV_TruckerNoTrailer, {4}, {1, 2, 3, 5}}, // LoadID 42
  63. {"LiveStock", false, 0.60, PCV_TruckerNoTrailer, {21, 22}, {23, 43, 47}}, // LoadID 43
  64. {"Meat", false, 0.60, PCV_TruckerNoTrailer, {43}, {44, 49, 50, 51, 52, 53}}, // LoadID 44
  65. {"Paper", false, 0.60, PCV_TruckerNoTrailer, {14}, {9, 62}}, // LoadID 45
  66. // Loads for pilots
  67. {"Passengers", false, 1.00, PCV_PilotPlane, {121, 122, 125, 126, 130, 131, 134}, {121, 122, 125, 126, 130, 131, 134}}, // LoadID 46
  68. {"Cargo", false, 1.00, PCV_PilotPlane, {123, 124, 127, 128, 129, 132, 133, 135}, {123, 124, 127, 128, 129, 132, 133, 135}}, // LoadID 47
  69. {"Passengers", false, 1.00, PCV_PilotHelicopter, {121, 122, 125, 126, 130, 131, 134}, {121, 122, 125, 126, 130, 131, 134}}, // LoadID 48
  70. // Loads for mafia
  71. {"Food", false, 1.50, PCV_MafiaVan, {7, 44, 47, 48}, {49, 50, 51, 52, 53}}, // LoadID 49
  72. {"Drinks", false, 1.50, PCV_MafiaVan, {15, 54, 55}, {49, 50, 51, 52, 53}}, // LoadID 50
  73. {"Bottled Beer", true, 1.50, PCV_MafiaVan, {56}, {57, 58, 59, 60, 61}}, // LoadID 51
  74. {"Luxury Goods", false, 1.50, PCV_MafiaVan, {24, 55}, {47, 48, 50}}, // LoadID 52
  75. {"Electronics", true, 1.50, PCV_MafiaVan, {7, 24, 48}, {50, 51, 62, 63}}, // LoadID 53
  76. {"Sport Equipment", false, 1.50, PCV_MafiaVan, {47, 48}, {50, 53, 57}}, // LoadID 54
  77. {"Boards", false, 1.50, PCV_MafiaVan, {10}, {4, 7, 18, 22}}, // LoadID 55
  78. {"Building Materials", false, 1.50, PCV_MafiaVan, {4}, {1, 2, 3, 5}}, // LoadID 56
  79. {"LiveStock", false, 1.50, PCV_MafiaVan, {21, 22}, {23, 43, 47}}, // LoadID 57
  80. {"Meat", false, 1.50, PCV_MafiaVan, {43}, {44, 49, 50, 51, 52, 53}}, // LoadID 58
  81. {"Paper", false, 1.50, PCV_MafiaVan, {14}, {9, 62}} // LoadID 59
  82. };
  83. // This function returns a string (array) that holds all ProductID's that are linked to a certain vehicletype (and player class)
  84. stock Product_GetList(PCV_Needed, &NumProducts)
  85. {
  86. // Setup local variables
  87. new ProductList[50];
  88. // Loop through all products
  89. for (new i; i < sizeof(ALoads); i++)
  90. {
  91. // Check if there aren't 50 products found (and added to the ProductList) yet
  92. if (NumProducts < 50)
  93. {
  94. // Check if the current product has the same PCV_Needed
  95. if (ALoads[i][PCV_Required] == PCV_Needed)
  96. {
  97. // Add the ProductID to the ProductList
  98. ProductList[NumProducts] = i;
  99. // Increase the counter NumProducts
  100. NumProducts++;
  101. }
  102. }
  103. }
  104. // Return the ProductList
  105. return ProductList;
  106. }
  107. // This function returns a random products for the given vehicletype (and player class)
  108. stock Product_GetRandom(PCV_Needed)
  109. {
  110. // Setup local variables
  111. new ProductList[50], NumProducts;
  112. // Get the entire product-list for this vehicle and class, and also the amount of products
  113. ProductList = Product_GetList(PCV_Needed, NumProducts);
  114. // Get a random product from this list and return it
  115. return ProductList[random(NumProducts)];
  116. }
  117. // This function returns a random startlocation from the given product (load)
  118. stock Product_GetRandomStartLoc(ProductID)
  119. {
  120. // Setup local variables
  121. new NumProducts;
  122. // First find out how many valid start-locations there are in this product
  123. for (new i; i < 30; i++)
  124. {
  125. // If the product has a valid location in this index
  126. if (ALoads[ProductID][FromLocations][i] != 0)
  127. NumProducts++; // Count the number of valid start-locations
  128. else // A start-location with ID 0 has been found (dummy-location)
  129. break; // Stop counting
  130. }
  131. // Return the LocationID that's stored at a random index
  132. return ALoads[ProductID][FromLocations][random(NumProducts)];
  133. }
  134. // This function returns a random endlocation from the given product (load)
  135. stock Product_GetRandomEndLoc(ProductID)
  136. {
  137. // Setup local variables
  138. new NumProducts;
  139. // First find out how many valid end-locations there are in this product
  140. for (new i; i < 30; i++)
  141. {
  142. // If the product has a valid location in this index
  143. if (ALoads[ProductID][ToLocations][i] != 0)
  144. NumProducts++; // Count the number of valid end-locations
  145. else // An end-location with ID 0 has been found (dummy-location)
  146. break; // Stop counting
  147. }
  148. // Return the LocationID that's stored at a random index
  149. return ALoads[ProductID][ToLocations][random(NumProducts)];
  150. }