Halvhjearne

fuckdlclock.sqf

May 7th, 2015
474
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.48 KB | None | 0 0
  1. /*
  2.     fuckdlclock.sqf by Halv
  3.  
  4.     Copyright (C) 2015  Halvhjearne
  5.  
  6.     This program is free software: you can redistribute it and/or modify
  7.     it under the terms of the GNU General Public License as published by
  8.     the Free Software Foundation, either version 3 of the License, or
  9.     (at your option) any later version.
  10.  
  11.     This program is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.     GNU General Public License for more details.
  15.  
  16.     You should have received a copy of the GNU General Public License
  17.     along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  
  19.     Contact : [email protected]
  20.    
  21.     put this file in a folder called custom in the root of your mission.pbo
  22.     in the init.sqf add this:
  23.  
  24.     ////////////////////////////////////
  25.     []execVM "custom\fuckdlclock.sqf";//
  26.     ////////////////////////////////////
  27. */
  28.  
  29. if((288520 in getDLCs 1) && (304380 in getDLCs 1))exitWith{diag_log "Player has DLC content";};
  30.  
  31. _DLCaction1 = -1;
  32. _DLCaction2 = -1;
  33. _DLCaction3 = -1;
  34. _DLCaction4 = -1;
  35. _DLCaction5 = -1;
  36.  
  37. if(isServer)exitWith{};
  38. waitUntil {!isNull (findDisplay 46)};
  39. waitUntil {!dialog};
  40.  
  41. sleep 5;
  42.  
  43. while{alive player}do{
  44.     _object = cursorTarget;
  45. // ROFL ...
  46.     if(!isNull _object)then{
  47.         _typeOf = typeOf _object;
  48.         if (288520 in getDLCs 2) then {
  49.             if(getText(configFile >> 'cfgvehicles' >> _typeOf >> 'DLC') == 'Kart' && player distance _object < 5 && isNull driver _object && locked _object in [0,1])then{
  50.                 if (_DLCaction1 < 0) then {
  51.                     _txt = (gettext (configFile >> 'cfgvehicles' >> _typeOf >> 'displayName'));
  52.                     _DLCaction1 = player addAction [format["<t color='#0096ff'>Get in %1 as Driver</t>",_txt],{player moveInDriver (_this select 3);},_object, 6, true, true, "", ""];
  53.                 };
  54.             }else{
  55.                 player removeAction _DLCaction1;
  56.                 _DLCaction1 = -1;
  57.             };
  58.         };
  59. // ROFL-Copter ...
  60.         if (304380 in getDLCs 2) then {
  61.             _dis = (sizeOf _typeOf)/2;
  62.             if(getText(configFile >> 'cfgvehicles' >> _typeOf >> 'DLC') == 'Heli' && player distance _object < _dis && locked _object < 2)then{
  63.                 if((_object EmptyPositions "Driver") >0)then{
  64.                     if (_DLCaction2 < 0) then {
  65.                         _txt = (gettext (configFile >> 'cfgvehicles' >> _typeOf >> 'displayName'));
  66.                         _DLCaction2 = player addAction [format["<t color='#0096ff'>Get in %1 as Pilot</t>",_txt],{player moveInDriver (_this select 3);},_object, 6, true, true, "", ""];
  67.                     };
  68.                 }else{
  69.                     player removeAction _DLCaction2;
  70.                     _DLCaction2 = -1;
  71.                 };
  72.                 if ((_object EmptyPositions "Gunner") >0)then{
  73.                     if (_DLCaction3 < 0) then {
  74.                         _txt = (gettext (configFile >> 'cfgvehicles' >> _typeOf >> 'displayName'));
  75.                         _DLCaction3 = player addAction [format["<t color='#0096ff'>Get in %1 as Gunner</t>",_txt],{player moveInGunner (_this select 3);},_object, 6, true, true, "", ""];
  76.                     };
  77.                 }else{
  78.                     player removeAction _DLCaction3;
  79.                     _DLCaction3 = -1;
  80.                 };
  81.                 if ((_object EmptyPositions "Commander") >0)then{
  82.                     if (_DLCaction4 < 0) then {
  83.                         _txt = (gettext (configFile >> 'cfgvehicles' >> _typeOf >> 'displayName'));
  84.                         _DLCaction4 = player addAction [format["<t color='#0096ff'>Get in %1 as Commander</t>",_txt],{player moveInCommander (_this select 3);},_object, 6, true, true, "", ""];
  85.                     };
  86.                 }else{
  87.                     player removeAction _DLCaction4;
  88.                     _DLCaction4 = -1;
  89.                 };
  90.                 if ((_object EmptyPositions "Cargo") >0)then{
  91.                     if (_DLCaction5 < 0) then {
  92.                         _txt = (gettext (configFile >> 'cfgvehicles' >> _typeOf >> 'displayName'));
  93.                         _DLCaction5 = player addAction [format["<t color='#0096ff'>Get in %1 as Cargo</t>",_txt],{player moveInCargo (_this select 3);},_object, 6, true, true, "", ""];
  94.                     };
  95.                 }else{
  96.                     player removeAction _DLCaction5;
  97.                     _DLCaction5 = -1;
  98.                 };
  99.             }else{
  100.                 {player removeAction _x}forEach[_DLCaction2,_DLCaction3,_DLCaction4,_DLCaction5];
  101.                 _DLCaction2 = -1;_DLCaction3 = -1;_DLCaction4 = -1;_DLCaction5 = -1;
  102.             };
  103.         };
  104.     }else{
  105.         {player removeAction _x}forEach[_DLCaction1,_DLCaction2,_DLCaction3,_DLCaction4,_DLCaction5];
  106.         _DLCaction1 = -1;_DLCaction2 = -1;_DLCaction3 = -1;_DLCaction4 = -1;_DLCaction5 = -1;
  107.     };
  108.     if(player != vehicle player)then{
  109.         {player removeAction _x}forEach[_DLCaction1,_DLCaction2,_DLCaction3,_DLCaction4,_DLCaction5];
  110.         _DLCaction1 = -1;_DLCaction2 = -1;_DLCaction3 = -1;_DLCaction4 = -1;_DLCaction5 = -1;
  111.     };
  112.     sleep 2;
  113. };
  114.  
  115. waitUntil{alive player};
  116.  
  117. [] execVM __FILE__;
Advertisement
Add Comment
Please, Sign In to add comment