Advertisement
Nebulazer

Untitled

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