Advertisement
Janne252

Untitled

Jun 24th, 2014
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.84 KB | None | 0 0
  1. function CustomStartingResourcesInit()
  2.     local ResourceSets = {
  3.         standard = {
  4.             --german:
  5.             [0] = {
  6.                 manpower = 490,
  7.                 fuel = 20,
  8.                 munition = 0,
  9.                 action = 0,
  10.                 command = 1,
  11.             },
  12.             --soviet:
  13.             [1] = {
  14.                 manpower = 490,
  15.                 fuel = 50,
  16.                 munition = 0,
  17.                 action = 0,
  18.                 command = 1,
  19.             },
  20.             --Obercommando west:
  21.             [2] = {
  22.                 manpower = 240,
  23.                 fuel = 40,
  24.                 munition = 0,
  25.                 action = 0,
  26.                 command = 1,
  27.             },
  28.             --us forces:
  29.             [3] = {
  30.                 manpower = 400,
  31.                 fuel = 15,
  32.                 munition = 0,
  33.                 action = 0,
  34.                 command = 1,
  35.             },
  36.         },
  37.         highResources = {
  38.             --german:
  39.             [0] = {
  40.                 manpower = 1390,
  41.                 fuel = 50,
  42.                 munition = 50,
  43.                 action = 0,
  44.                 command = 2,
  45.             },
  46.             --soviet:
  47.             [1] = {
  48.                 manpower = 1390,
  49.                 fuel = 80,
  50.                 munition = 50,
  51.                 action = 0,
  52.                 command = 2,
  53.             },
  54.             --Obercommando west:
  55.             [2] = {
  56.                 manpower = 1140,
  57.                 fuel = 70,
  58.                 munition = 50,
  59.                 action = 0,
  60.                 command = 2,
  61.             },
  62.             --us forces:
  63.             [3] = {
  64.                 manpower = 1300,
  65.                 fuel = 45,
  66.                 munition = 50,
  67.                 action = 0,
  68.                 command = 2,
  69.             },
  70.         },
  71.         customSet_01 = {
  72.             --german:
  73.             [0] = {
  74.                 manpower = 2000,
  75.                 fuel = 80,
  76.                 munition = 100,
  77.                 action = 0,
  78.                 command = 2,
  79.             },
  80.             --soviet:
  81.             [1] = {
  82.                 manpower = 2000,
  83.                 fuel = 100,
  84.                 munition = 100,
  85.                 action = 0,
  86.                 command = 2,
  87.             },
  88.             --Obercommando west:
  89.             [2] = {
  90.                 manpower = 2000,
  91.                 fuel = 80,
  92.                 munition = 100,
  93.                 action = 0,
  94.                 command = 2,
  95.             },
  96.             --us forces:
  97.             [3] = {
  98.                 manpower = 2000,
  99.                 fuel = 80,
  100.                 munition = 100,
  101.                 action = 0,
  102.                 command = 2,
  103.             },
  104.         },
  105.         customSet_02 = {
  106.                 --german:
  107.             [0] = {
  108.                 manpower = 0,
  109.                 fuel = 0,
  110.                 munition = 0,
  111.                 action = 0,
  112.                 command = 0,
  113.             },
  114.             --soviet:
  115.             [1] = {
  116.                 manpower = 0,
  117.                 fuel = 0,
  118.                 munition = 0,
  119.                 action = 0,
  120.                 command = 0,
  121.             },
  122.             --Obercommando west:
  123.             [2] = {
  124.                 manpower = 0,
  125.                 fuel = 0,
  126.                 munition = 0,
  127.                 action = 0,
  128.                 command = 0,
  129.             },
  130.             --us forces:
  131.             [3] = {
  132.                 manpower = 0,
  133.                 fuel = 0,
  134.                 munition = 0,
  135.                 action = 0,
  136.                 command = 0,
  137.             },
  138.         },
  139.     }
  140.     --This will set the resource set to use in-game
  141.     local g_ResourceSet = ResourceSets.standard
  142.    
  143.     local Player_ApplyResourceSet = function(player, resourceSet)
  144.         Player_SetResource(player, RT_Manpower, resourceSet.manpower)
  145.         Player_SetResource(player, RT_Fuel, resourceSet.fuel)
  146.         Player_SetResource(player, RT_Munition, resourceSet.munition)
  147.         Player_SetResource(player, RT_Action, resourceSet.action)
  148.         Player_SetResource(player, RT_Command, resourceSet.command)
  149.     end
  150.    
  151.     for i = 1, World_GetPlayerCount() do
  152.         local player = World_GetPlayerAt(i)
  153.         Player_ApplyResourceSet(player, g_ResourceSet[Player_GetRace(player)])
  154.     end
  155. end
  156.  
  157. Scar_AddInit(CustomStartingResourcesInit)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement