From 2799fff664dd7e2f3ce50c6bccba8d0a553dc98b Mon Sep 17 00:00:00 2001 From: nomisum Date: Fri, 22 Jan 2016 18:17:36 +0100 Subject: [PATCH] bonus money should work first time now too --- init.sqf | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/init.sqf b/init.sqf index 91369708..79f6af41 100644 --- a/init.sqf +++ b/init.sqf @@ -112,13 +112,24 @@ if (isServer) then { REPLAY_STEPS_PER_TICK = 1; - _playercount = count allPlayers; - _bonusPerPlayer = _playercount * 100; + - russianCredits = OPFOR_MONEY + _bonusPerPlayer; - USCredits = BLUFOR_MONEY + _bonusPerPlayer; + russianCredits = OPFOR_MONEY; + USCredits = BLUFOR_MONEY; 0 = [russianCredits,USCredits] execVM "spawn\gui\addPublicVariableEventhandler.sqf"; + + [] spawn { + waitUntil {count allPlayers > 0}; + _playercount = count allPlayers; + _bonusPerPlayer = _playercount * 100; + + russianCredits = OPFOR_MONEY + _bonusPerPlayer; + USCredits = BLUFOR_MONEY + _bonusPerPlayer; + + 0 = [russianCredits,USCredits] execVM "spawn\gui\addPublicVariableEventhandler.sqf"; + + }; if (isClass (configFile >> "CfgPatches" >> "task_force_radio")) then { [] execVM "tfarsettings.sqf";