Advertisement
Nebulazer

Untitled

Aug 20th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 19.10 KB | None | 0 0
  1. waitUntil {alive player};
  2.  
  3. //Define UI ctrls
  4. #define UIlevel 1000
  5. #define UIprogress 1001
  6. #define UIprogressBar 1002
  7. #define UIcash 1003
  8. #define UIkills 1004
  9.  
  10.                 player allowDamage true;
  11.                 player enableSimulation true;
  12.                 (_this select 0) enableStamina false;
  13.                 player hideObject false;
  14.                 enableSentences false;
  15.                 private _proXP = profileNamespace getVariable "pro_experience";
  16.                 if (isNil "_proXP") then
  17.                 {
  18.                     profileNamespace setVariable ["pro_experience", 0];
  19.                     _proXP = 0;
  20.                 };
  21.                 private _proCash = profileNamespace getVariable "pro_cash";
  22.                 if (isNil "_proCash") then
  23.                 {
  24.                     profileNamespace setVariable ["pro_cash", 0];
  25.                     _proCash = 0;
  26.                 };
  27.                 private _proKills = profileNamespace getVariable "pro_kills";
  28.                 if (isNil "_proKills") then
  29.                 {
  30.                     profileNamespace setVariable ["pro_kills", 0];
  31.                     _proKills = 0;
  32.                 };
  33.                 private _proLevel = profileNamespace getVariable "pro_level";
  34.                 if (isNil "_proLevel") then
  35.                 {
  36.                     profileNamespace setVariable ["pro_level", 0];
  37.                     _proLevel = 0;
  38.                 };
  39.                  _cash = switch (_proCash) do {
  40.                             case 0: {500};
  41.                             default {_proCash};
  42.                             };
  43.                 player setVariable ["cash", _cash, true];
  44.  
  45.                  _level = switch (_proLevel) do {
  46.                             case 0: {1};
  47.                             default {_proLevel};
  48.                             };
  49.                 player setVariable ["level", _level, true];
  50.                
  51.                  _myXP = switch (_proXP) do {
  52.                             case 0: {0};
  53.                             default {_proXP};
  54.                             };
  55.                 player setVariable ["experience", _myXP, true];
  56.                
  57.                 _kills = switch (_proXP) do {
  58.                             case 0: {0};
  59.                             default {_proKills};
  60.                             };
  61.                 player setVariable ["kills", _kills, true];
  62.                
  63.                
  64.                
  65. /*
  66.    
  67.                 switch (side player) do {
  68.  
  69.                         case west: {
  70.                        
  71.                         player setPos [2938.69,13107.5,0];
  72.                         //playSound "airplanes";
  73.                        
  74.                        
  75.                         };
  76.  
  77.                         case east: {
  78.                        
  79.                         player setPos [2695.89,12334.4,0];
  80.                         //playSound "airplanes";
  81.                        
  82.                        
  83.                         };
  84.                         default {player setPos [0,0,0];};
  85.  
  86.                 };
  87. */     
  88. //Add event to player
  89.  
  90. player addEventHandler [ "Killed", {
  91.  
  92.     //Get passed killed and killer
  93.     _unit = _this select 0;
  94.     _killer = _this select 1;
  95.  
  96.     //If we were killed by a player AND did not kill ourself
  97.     if ( isPlayer _killer && !( _killer isEqualTo _unit ) ) then {
  98.  
  99.         //Is our killer an enemy
  100.         _killedSide = ( getNumber ( configFile >> "CfgVehicles" >> typeOf _unit >> "side" ) ) call BIS_fnc_sideType;
  101.         _isEnemy = _killedSide getFriend side _killer < 0.6;
  102.  
  103.         //Get killers stats
  104.         _currentCash = _killer getVariable [ "cash", 0 ];
  105.         _currentExperience = _killer getVariable [ "experience", 0 ];
  106.         _currentKills = _killer getVariable [ "kills", 0 ];
  107.  
  108.         //If killer was an enemy
  109.         if ( _isEnemy ) then {
  110.  
  111.             //Increase their stats
  112.             _killer setVariable [ "cash", ( _currentCash + 500 ) , true ];
  113.             _killer setVariable [ "experience", ( _currentExperience + 200 ) , true ];
  114.             _killer setVariable [ "kills", ( _currentKills + 1 ) , true ];
  115.  
  116.         }else{
  117.  
  118.             //Decrease their stats
  119.             _killer setVariable [ "cash", ( _currentCash - 100 ) max 0 , true ];
  120.             _killer setVariable [ "experience", ( _currentExperience - 200 ) max 0 , true ];
  121.         };
  122.  
  123.         //Call updateStats on killers client
  124.         [ [], "fnc_updateStats", _killer ] call BIS_fnc_MP;
  125.     };
  126.  
  127. }];
  128.  
  129.  
  130.  
  131. //Function to update stats
  132. fnc_updateStats = {
  133.     //Get current experience
  134.    
  135.                
  136.     _exp = player getVariable [ "experience", 0 ];
  137.     _myLvl = player getVariable [ "level", 0 ];
  138.     _tmpExp = _exp;
  139.     _level = 0;
  140.     _oldLevel = _myLvl;
  141.  
  142.     //Max value of level 1
  143.     _expForNextLevel = 100;
  144.     //Work out new level
  145.     while { _tmpExp >= _expForNextLevel } do {
  146.         _level = _level + 1;
  147.         _tmpExp = _tmpExp - _expForNextLevel;
  148.         //Every level needs twice as much exp as the level before
  149.         _expForNextLevel = _expForNextLevel * 2;
  150.     };
  151.     //Set players level, minimum it can be is 0
  152.     _myLvl = _level max 0;
  153.  
  154.     //If we increased in level
  155.     if ( _level > _oldLevel ) then {
  156.         //Inform player of level increase
  157.         hint format [ " LEVEL UP \nNow Level %1", _myLvl ];
  158.         [ [], "fnc_levelUpRewards", player ] call BIS_fnc_MP;
  159.     };
  160.  
  161.     //Get progress to next level
  162.     _progress = linearConversion [ 0, _expForNextLevel, _tmpExp, 0, 1 ];
  163.     //Get player stats
  164.     _cash = player getVariable [ "cash", 0 ];
  165.     _kills = player getVariable [ "kills", 0 ];
  166.     player setVariable [ "level", _myLvl, true ];
  167.    
  168.     profileNamespace setVariable [ "pro_level", _myLvl];
  169.     profileNamespace setVariable [ "pro_experience", _tmpExp];
  170.     profileNamespace setVariable [ "pro_cash", _cash];
  171.     profileNamespace setVariable [ "pro_kills", _kills];
  172.     saveProfileNamespace;
  173.    
  174.  
  175.     //Update UI with stats
  176.     (uiNamespace getVariable "UIplayerInfo" displayCtrl UIlevel ) ctrlSetText ( format [ "Level : %1", _myLvl ] );
  177.     (uiNamespace getVariable "UIplayerInfo" displayCtrl UIprogress ) ctrlSetText ( format [ "XP : %1/%2", _tmpExp, _expForNextLevel ] );
  178.     (uiNamespace getVariable "UIplayerInfo" displayCtrl UIprogressBar ) progressSetPosition _progress;
  179.     (uiNamespace getVariable "UIplayerInfo" displayCtrl UIcash ) ctrlSetText ( format [ "Money : $%1", _cash ] );
  180.     (uiNamespace getVariable "UIplayerInfo" displayCtrl UIkills ) ctrlSetText ( format [ "Kills : %1", _kills ] ); 
  181. };
  182.  
  183. fnc_showLevelUp = {
  184.     _myLvl = player getVariable [ "level", 0 ];
  185.     _cashUp = player getVariable [ "cashGain", 0];
  186.     if (_myLvl > 1) then {
  187.     _lvlText = format [ " LEVEL UP!<br /> Now Level %1", _myLvl ];
  188.     ["<t color='#B8AB67' size = '.4'>" + _lvlText + "</t>",safezoneX + 0.3 * safezoneW,safezoneY,4,1,0,789] call bis_fnc_dynamicText;
  189.     };
  190. if (_cashUp > 0) then {
  191.     _cashText = format [ " $%1", _cashUp];
  192.     ["<t color='#B8AB67' size = '.4'>" + _cashText + "</t>",safezoneX + 0.25 * safezoneW,safezoneY,4,1,0,789] call bis_fnc_dynamicText;
  193.     };
  194. };
  195.  
  196. fnc_showCashGain = {
  197.     _cashUp = player getVariable [ "cashGain", 0];
  198.     if (_cashUp > 0) then {
  199.     _cashText = format [ " $%1", _cashUp];
  200.     ["<t color='#B8AB67' size = '.4'>" + _cashText + "</t>",safezoneX + 0.25 * safezoneW,safezoneY,4,1,0,789] call bis_fnc_dynamicText;
  201.     _killer setVariable [ "cashGain",0, true ];
  202.     };
  203. };
  204.  
  205. fnc_levelUpRewards = {
  206.                     private [ "_currentWeapon", "_cfg", "_compatibleMags", "_myLvl" ];
  207.                     _myLvl = player getVariable [ "level", 0 ];
  208.                     _currentWeapon = primaryWeapon player;
  209.                     _cfg = configFile >> "CfgWeapons" >> _currentWeapon;
  210.                     _compatibleMags = [];
  211.                     {
  212.                         if ( _x == "this" ) then {
  213.                             _compatibleMags = _compatibleMags + getArray( _cfg >> "magazines" );
  214.                         }else{
  215.                             _compatibleMags = _compatibleMags + getArray( _cfg >> _x >> "magazines" );
  216.                         };
  217.                     }forEach getArray( _cfg >> "muzzles" );
  218.                     _mainMag = _compatibleMags select 0;
  219.                     _currentPack = backpack player;
  220.  
  221.                         if ((player canAdd "optic_ACO") && (_myLvl ==1)) then {
  222.                         [ [], "neb_fnc_core_levelRewards", player ] call BIS_fnc_MP;
  223.                         player addPrimaryWeaponItem 'optic_ACO';
  224.                         hint "";
  225.                         };
  226.                         if ((player canAdd [_mainMag, 2]) && (_myLvl ==2)) then {
  227.                         player addMagazine 'HandGrenade';
  228.                         player addMagazine _mainMag;
  229.                         };
  230.                         if ((player canAdd [_mainMag, 3]) && (_myLvl ==3)) then {
  231.                         player addMagazine 'HandGrenade';
  232.                         player addMagazines [_mainMag, 2];
  233.                         if (_currentPack == "") then {
  234.                             switch (playerSide) do {
  235.                                     case west: {
  236.                                     player addBackpack "B_AssaultPack_tna_F";
  237.                                     };
  238.                                     case east: {
  239.                                     player addBackpack "B_FieldPack_ghex_F"
  240.                                     };
  241.                                 };
  242.                             };
  243.                         };
  244.                         if ((player canAdd [_mainMag, 4]) && (_myLvl ==4)) then {
  245.                         player addMagazine 'HandGrenade';
  246.                         player addMagazines [_mainMag, 3];
  247.                         };
  248.                         if ((player canAdd [_mainMag, 5]) && (_myLvl ==5)) then {
  249.                         player addMagazine 'HandGrenade';
  250.                         player addMagazines [_mainMag, 4];
  251.                         switch (playerSide) do {
  252.                                 case west: {
  253.                                 execVM "Classes\AI\bluRifleMan.sqf";
  254.                                 };
  255.                                 case east: {
  256.                                
  257.                                 };
  258.                             };
  259.                         };
  260.                         if ((player canAdd [_mainMag, 5]) && (_myLvl ==6)) then {
  261.                         player addMagazine 'HandGrenade';
  262.                         player addMagazines [_mainMag, 4];
  263.                         };
  264.                         if ((player canAdd [_mainMag, 5]) && (_myLvl ==7)) then {
  265.                         player addMagazine 'HandGrenade';
  266.                         player addMagazines [_mainMag, 4];
  267.                         switch (playerSide) do {
  268.                                 case west: {
  269.                                 execVM "Classes\AI\bluRifleMan.sqf";
  270.                                 };
  271.                                 case east: {
  272.                                
  273.                                 };
  274.                             };
  275.                         };
  276.                         if ((player canAdd [_mainMag, 5]) && (_myLvl ==8)) then {
  277.                         player addMagazine 'HandGrenade';
  278.                         player addMagazines [_mainMag, 4];
  279.                         };
  280.                         if ((player canAdd [_mainMag, 5]) && (_myLvl ==9)) then {
  281.                         player addMagazine 'HandGrenade';
  282.                         player addMagazines [_mainMag, 4];
  283.                         switch (playerSide) do {
  284.                                 case west: {
  285.                                 execVM "Classes\AI\bluRifleMan.sqf";
  286.                                 };
  287.                                 case east: {
  288.                                
  289.                                 };
  290.                             };
  291.                         };
  292.                         if ((player canAdd [_mainMag, 5]) && (_myLvl ==10)) then {
  293.                         player addMagazine 'HandGrenade';
  294.                         player addMagazines [_mainMag, 4];
  295.                             };
  296.    
  297.                         };
  298.    
  299.  
  300.  
  301.  
  302.  
  303.  
  304. fnc_endTimer = {
  305.  
  306. END_TIME = 30; //When mission should end in seconds.
  307.  
  308. if (isServer) then {
  309.     [] spawn
  310.     {
  311.                 ELAPSED_TIME  = 0;
  312.         START_TIME = diag_tickTime;
  313.         while {ELAPSED_TIME < END_TIME} do
  314.         {
  315.             ELAPSED_TIME = diag_tickTime - START_TIME;
  316.             publicVariable "ELAPSED_TIME";
  317.             sleep 1;
  318.         };
  319.     };
  320. };
  321.  
  322.  
  323. if!(isDedicated) then
  324. {
  325.     [] spawn
  326.     {
  327.         while{ELAPSED_TIME < END_TIME } do
  328.         {
  329.             _time = END_TIME - ELAPSED_TIME;
  330.             _finish_time_minutes = floor(_time / 60);
  331.             _finish_time_seconds = floor(_time) - (60 * _finish_time_minutes);
  332.             if(_finish_time_seconds < 10) then
  333.             {
  334.                 _finish_time_seconds = format ["0%1", _finish_time_seconds];
  335.             };
  336.             if(_finish_time_minutes < 10) then
  337.             {
  338.                 _finish_time_minutes = format ["0%1", _finish_time_minutes];
  339.             };
  340.             _formatted_time = format ["%1:%2", _finish_time_minutes, _finish_time_seconds];
  341.            
  342.             hintSilent format ["Time left:\n%1", _formatted_time];
  343.             sleep 1;
  344.             };
  345.         };
  346.     };
  347. };
  348.  
  349.  
  350. fnc_addSprintSuitA = {
  351. player forceAddUniform "U_O_Protagonist_VR";
  352. [ [], "NEB_fnc_isSpecialSuit", player ] call BIS_fnc_MP;
  353. };
  354.  
  355. fnc_addSprintSuitB = {
  356. player forceAddUniform "U_B_Protagonist_VR";
  357. [ [], "NEB_fnc_isSpecialSuit", player ] call BIS_fnc_MP;
  358. };
  359. fnc_addSprintSuitC = {
  360. player forceAddUniform "U_I_Protagonist_VR";
  361. [ [], "NEB_fnc_isSpecialSuit", player ] call BIS_fnc_MP;
  362. };
  363. fnc_redSuit = {
  364. player forceAddUniform "U_O_Soldier_VR";
  365. [ [], "NEB_fnc_isSpecialSuit", player ] call BIS_fnc_MP;
  366. };
  367. fnc_bluSuit = {
  368. player forceAddUniform "U_B_Soldier_VR";
  369. [ [], "NEB_fnc_isSpecialSuit", player ] call BIS_fnc_MP;
  370. };
  371.  
  372. fnc_bubEffect = {
  373.     params[ "_objNetID" ];
  374.    
  375.     _unit = objectFromNetId _objNetID;
  376.    
  377.     _unit setVariable[ "bubEffect", true ]; //local object variable
  378.    
  379.     if ( local _unit ) then {
  380.         _unit allowDamage false; //AL and EG
  381.     };
  382.    
  383.     _unit setAnimSpeedCoef 2;//Unsure of locality needs testing
  384.     _unit switchMove "AmovPercMstpSnonWnonDnon_EaseIn"; //AG and EL
  385.     _unit setAnimSpeedCoef 0; //Unsure of locality needs testing
  386.    
  387.     while ( _unit getVariable[ "bubEffect", false ] ) do {
  388.        
  389.         drop [ //EL
  390.             ["\A3\data_f\ParticleEffects\Universal\Universal",16,13,7,0],"","BillBoard",
  391.             1,1,[0,0.25,1],[0,0,0],
  392.             random pi*2,1.277,1,0,
  393.             [3],
  394.             [[1,0,0,.5],[1,0,0,.5]],
  395.             [10000],
  396.             0,0,"","",
  397.             _unit,0,
  398.             false,-1
  399.         ];
  400.        
  401.         playSound "electricshock"; //EL
  402.         _unit switchMove "AmovPercMstpSnonWnonDnon_Ease"; //AG and EL
  403.        
  404.         sleep 0.25; //This is the equivilent of you action per tick 6/24 = 0.25 seconds
  405.     };
  406. };
  407.  
  408.  
  409. fnc_bubFinish = {
  410.     params[ "_objNetID" ];
  411.    
  412.     _unit = objectFromNetId _objNetID;
  413.    
  414.     //Stop the particle loop
  415.     _unit setVariable[ "bubEffect", false ];
  416.    
  417.     if ( local _unit ) then {
  418.         //allowDamage is AL( arguments local ) EG( effects global )
  419.         //So only where the unit is local( argument )
  420.         //the Effects will be seen on all machine( effect global )  
  421.         _unit allowDamage true; //AL and EG
  422.     };
  423.    
  424.     _unit setAnimSpeedCoef 1; //Unsure of locality needs testing
  425.     _unit switchMove ""; //AG and EL
  426. };
  427.  
  428.  
  429. fnc_suitAbilities = {
  430.  _skillA = [
  431. /* 0 object */              player,
  432. /* 1 action title */            "Sprint 1",
  433. /* 2 idle icon */               "images\sprinticonA.paa",
  434. /* 3 progress icon */           "images\sprinticonA.paa",
  435. /* 4 condition to show */       "player getvariable [ 'Sprint', false ]",
  436. /* 5 condition for action */        "true",
  437. /* 6 code executed on start */      {player setAnimSpeedCoef 1},
  438. /* 7 code executed per tick */      {
  439.      _progress = param[ 4 ]; //max progress is always 24
  440.     player setAnimSpeedCoef ( linearConversion[ 0, 24, _progress, 1.5, 2 ] );
  441. },
  442. /* 8 code executed on completion */ {player setAnimSpeedCoef 1},
  443. /* 9 code executed on interruption */   {player setAnimSpeedCoef 1},
  444. /* 10 arguments */          ["Sprint"],
  445. /* 11 action duration */        6,
  446. /* 12 priority */           0,
  447. /* 13 remove on completion */       false,
  448. /* 14 show unconscious */       false
  449. ] call bis_fnc_holdActionAdd;
  450.  
  451. _skillB = [
  452. /* 0 object */              player,
  453. /* 1 action title */            "Sprint 2",
  454. /* 2 idle icon */               "images\sprinticonA.paa",
  455. /* 3 progress icon */           "images\sprinticonA.paa",
  456. /* 4 condition to show */       "player getvariable [ 'Sprint2', false ]",
  457. /* 5 condition for action */        "true",
  458. /* 6 code executed on start */      {player setAnimSpeedCoef 1.50},
  459. /* 7 code executed per tick */      {
  460.      _progress = param[ 4 ]; //max progress is always 24
  461.     player setAnimSpeedCoef ( linearConversion[ 0, 32, _progress, 1.5, 4 ] );
  462. },
  463. /* 8 code executed on completion */ {player setAnimSpeedCoef 1},
  464. /* 9 code executed on interruption */   {player setAnimSpeedCoef 1},
  465. /* 10 arguments */          ["Sprint"],
  466. /* 11 action duration */        6,
  467. /* 12 priority */           0,
  468. /* 13 remove on completion */       false,
  469. /* 14 show unconscious */       false
  470. ] call bis_fnc_holdActionAdd;
  471. _skillC = [
  472. /* 0 object */              player,
  473. /* 1 action title */            "Sprint 3",
  474. /* 2 idle icon */               "images\sprinticonA.paa",
  475. /* 3 progress icon */           "images\sprinticonA.paa",
  476. /* 4 condition to show */       "player getvariable [ 'Sprint3', false ]",
  477. /* 5 condition for action */        "true",
  478. /* 6 code executed on start */      {player setAnimSpeedCoef 1.70},
  479. /* 7 code executed per tick */      {
  480.      _progress = param[ 4 ]; //max progress is always 24
  481.     player setAnimSpeedCoef ( linearConversion[ 1.7, 32, _progress, 1.5, 6 ] );
  482. },
  483. /* 8 code executed on completion */ {player setAnimSpeedCoef 1},
  484. /* 9 code executed on interruption */   {player setAnimSpeedCoef 1},
  485. /* 10 arguments */          ["Sprint"],
  486. /* 11 action duration */        12,
  487. /* 12 priority */           0,
  488. /* 13 remove on completion */       false,
  489. /* 14 show unconscious */       false
  490. ] call bis_fnc_holdActionAdd;
  491. _skillD = [
  492. /* 0 object */              player,
  493. /* 1 action title */            "Lightning",
  494. /* 2 idle icon */               "images\blinkicon.paa",
  495. /* 3 progress icon */           "images\blinkicon.paa",
  496. /* 4 condition to show */       "player getvariable [ 'Lightning', false ]",
  497. /* 5 condition for action */        "true",
  498. /* 6 code executed on start */      {["Suit", "Preparing Lightning"] call BIS_fnc_showSubtitle},
  499. /* 7 code executed per tick */      {hint "Lightning Charging"},
  500. /* 8 code executed on completion */ {[] call neb_fnc_core_strikeLightning;},
  501. /* 9 code executed on interruption */   {hint ""},
  502. /* 10 arguments */          ["Lightning"],
  503. /* 11 action duration */        3,
  504. /* 12 priority */           0,
  505. /* 13 remove on completion */       false,
  506. /* 14 show unconscious */       false
  507. ] call bis_fnc_holdActionAdd;
  508. _skillE = [
  509.     player,                         //  0 object
  510.     "Bubble",                       //  1 action title
  511.     "images\blinkicon.paa",                 //  2 idle icon
  512.     "images\blinkicon.paa",                 //  3 progress icon
  513.     "player getvariable [ 'Bubble', false ]",       //  4 condition to show
  514.     "true",                         //  5 condition for action
  515.    
  516.     //  6 code executed on start
  517.     {
  518.         //Create a unique name for the jip queue
  519.         [ netId player ] remoteExec [ "fnc_bubEffect", 0, format[ "%1_bub", netId player ] ];
  520.     },
  521.    
  522.     //  7 code executed per ACTION tick ( Range 0 - 24 ), tick duration = action duration / MAX tick 24  
  523.     {},
  524.    
  525.     //  8 code executed on completion
  526.     {
  527.         //No JIP
  528.         [ netId player ] remoteExec [ "fnc_bubFinish", 0 ];
  529.         //Remove start from JIP queue
  530.         remoteExec [ "", format[ "%1_bub", netId player ] ]
  531.     },
  532.    
  533.     //  9 code executed on interruption
  534.     {
  535.         //No JIP
  536.         [ netId player ] remoteExec [ "fnc_bubFinish", 0 ];
  537.         //Remove start from JIP queue
  538.         remoteExec [ "", format[ "%1_bub", netId player ] ]
  539.     },
  540.    
  541.     [],                         // 10 arguments
  542.     6,                          // 11 action duration
  543.     0,                          // 12 priority
  544.     false,                          // 13 remove on completion
  545.     false                           // 14 show unconscious
  546. ] call BIS_fnc_holdActionAdd;
  547.  //player setVariable ["skillA", _skillA];
  548. // player setVariable ["skillB", _skillB];
  549.  //player setVariable ["skillC", _skillC];
  550. // player setVariable ["skillD", _skillD];
  551. };
  552. player addEventHandler [ "Take", {
  553.     [] call NEB_fnc_isSpecialSuit;
  554. }];
  555.  
  556. player addEventHandler [ "Put", {
  557.     [] call NEB_fnc_isSpecialSuit;
  558. }];
  559.  
  560. NEB_fnc_isSpecialSuit = {
  561.     private [ "_suitIndex" ];
  562.     _specialSuits = [ "U_O_Protagonist_VR", "U_B_Protagonist_VR", "U_I_Protagonist_VR", "U_C_Driver_1_black", "U_C_Driver_1_white" ];
  563.    
  564.     _isWearing = uniform player in _specialSuits;
  565.     if ( _isWearing ) then {
  566.         _suitIndex = _specialSuits find uniform player;
  567.     };
  568.     _wasWearing = { _x }count ( player getVariable [ "hasSpecialSuit", [ false, false, false, false, false ] ] ) > 0;
  569.  
  570.    
  571.     if ( _wasWearing && !_isWearing ) then {
  572.         player setVariable [ "hasSpecialSuit", [ false, false, false, false, false ] ];
  573.         [ -1 ] call NEB_fnc_suitChanged;
  574.         hint format [ "%1 took off Special Suit", name player ];
  575.     };
  576.    
  577.     if ( _isWearing ) then {
  578.         _flags = player getVariable [ "hasSpecialSuit", [ false, false, false, false, false ] ];
  579.         {
  580.             if ( _forEachIndex isEqualTo _suitIndex ) then {
  581.                 if !( _x ) then {
  582.                     hint format [ "%1 put on Special Suit", name player ];
  583.                     _flags set [ _forEachIndex, true ];
  584.                     [ _suitIndex ] call NEB_fnc_suitChanged;
  585.                 };
  586.             }else{
  587.                 _flags set [ _forEachIndex, false ];
  588.             };
  589.         }forEach _flags;
  590.  
  591.         player setVariable [ "hasSpecialSuit", _flags ];
  592.        
  593.     };
  594. };
  595. [] call NEB_fnc_isSpecialSuit;
  596. NEB_fnc_suitChanged = {
  597.     private[ "_newAbilities" ];
  598.     params[ "_suitIndex" ];
  599.    
  600.     _allAbilities = [ "Sprint", "Sprint2", "Sprint3", "Lightning", "Bubble" ];
  601.    
  602.     _suitAbilities = [
  603.         [ "Sprint" ],
  604.         [ "Sprint2" ],
  605.         [ "Sprint3" ],
  606.         [ "Sprint3", "Lightning" ],
  607.         [ "Sprint3", "Bubble" ]
  608.     ];
  609.    
  610.     if ( _suitIndex > -1 ) then {
  611.         _newAbilities = _suitAbilities select _suitIndex;
  612.     }else{
  613.         _newAbilities = [];
  614.     };
  615.    
  616.     {
  617.         if ( _x in _newAbilities ) then {
  618.             player setVariable[ _x, true ];
  619.         }else{
  620.             player setVariable[ _x, false ];
  621.         };
  622.     }forEach _allAbilities;
  623. };
  624.  
  625. [] spawn neb_fnc_core_openChute;
  626. //Starting UI stats and groups
  627. ( [ "playerInfo" ] call BIS_fnc_rscLayer ) cutRsc [ "playerInfo", "PLAIN", 1, false ];
  628. [] call fnc_updateStats;
  629. //[] call neb_fnc_core_startingStats;
  630. ["InitializePlayer", [player]] call BIS_fnc_dynamicGroups;
  631. [player] call neb_fnc_core_disableStamina;
  632.  
  633. NEB_fnc_getPlayerLevel = {
  634.     player getVariable [ "level", 0 ];
  635. };
  636.  
  637. NEB_fnc_getPlayerCash = {
  638.     player getVariable [ "cash", 0 ];
  639. };
  640.  
  641. [] spawn neb_fnc_core_addPlayerIcons;
  642.  
  643. 0 = ["players","ai"] call neb_fnc_core_playerMarkers;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement