Advertisement
darkstaride

test

Nov 25th, 2015
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 4.73 KB | None | 0 0
  1. /* =============================================
  2.         init_client.sqf executes everything that is needed
  3.         Authors: richarddanh.com
  4.         www.pizzadox.org
  5. ================================================= */
  6. #define startinggear ["ACE_Earplugs",
  7.                                 "ItemGPS",
  8.                                 "ItemWatch",
  9.                                 "ACRE_PRC343",
  10.                                 "ACRE_PRC148",
  11.                                 "ACRE_PRC152",
  12.                                 "ACE_Map_Tools",
  13.                                 "ACE_GlassesLHD_glasses",
  14.                                 "ACE_GlassesGasMask_US",
  15.                                 "ACE_Map",
  16.                                 "ItemCompass",
  17.                                 "NVGoggles",
  18.                                 "Binocular"];
  19.  
  20. client_execution = {
  21.         if (isplayer player) then
  22.         {
  23.                 waituntil {local player};
  24.                                 player enableSimulation false;
  25.                                 2003 CutText ["Initialising...", "BLACK"];
  26.                                 //calculate time
  27.                 _future = time + 5;
  28.                 waitUntil {(time >= _future)};
  29.                                 defaultloadoutinit = [player] spawn {
  30.                                         _unit = _this select 0;
  31.                                         removeAllWeapons _unit;
  32.                                         removeAllItems _unit;
  33.                                         clearMagazineCargo (unitBackpack _unit);
  34.                                         [_unit, "ALL"] call ACE_fnc_RemoveGear;
  35.                                         {_unit addweapon _x} foreach startinggear;
  36.                                         [_unit] execFSM "x\ace\addons\sys_goggles\use_earplug.fsm";
  37.                                         [_unit, "ACE_GlassesLHD_glasses"] execFSM "x\ace\addons\sys_goggles\use_glasses.fsm";
  38.                                 };
  39.                 ace_sys_tracking_markers_enabled = false;
  40.                                 ace_sys_eject_fnc_weaponcheck = {};
  41.                 setViewDistance 1609;
  42.                 setTerrainGrid 50;
  43.                 onMapSingleClick {_shift};
  44.                 player setskill 0;
  45.                 player setVariable ["BIS_noCoreConversations", true];
  46.                 enableRadio false;
  47.                 {player disableAI _x} foreach ["MOVE","ANIM","TARGET","AUTOTARGET"];
  48.                 [] call (compile (preprocessFileLineNumbers ("\ca\Modules\MP\data\scripts\MPframework.sqf")));
  49.                                 waitUntil { scriptDone defaultloadoutinit };
  50.                                 titleFadeOut 0.1;
  51.                                 2003 CutText ["Initialisation Completed", "BLACK IN", 5];
  52.                                 diag_log format ["Mission Initialisation Completed for: %1 at: %2", player, time];
  53.                                 player enablesimulation true;
  54.                                 player addEventHandler ["Respawn",{
  55.                                         _unit = _this select 0;
  56.                                         removeAllWeapons _unit;
  57.                                         removeAllItems _unit;
  58.                                         clearMagazineCargo (unitBackpack _unit);
  59.                                         [_unit, "ALL"] call ACE_fnc_RemoveGear;
  60.                                         {_unit addweapon _x} foreach startinggear;
  61.                                         [_unit] execFSM "x\ace\addons\sys_goggles\use_earplug.fsm";
  62.                                         [_unit, "ACE_GlassesLHD_glasses"] execFSM "x\ace\addons\sys_goggles\use_glasses.fsm";
  63.                                 }];
  64.                                 [] spawn {
  65.                                         sleep 5;
  66.                                         [str ("Template"), str("Chernarus"), str(date select 1) + "." + str(date select 2) + "." + str(date select 0)] spawn BIS_fnc_infoText;
  67.                                 };
  68.         };
  69. };
  70.  
  71. player call client_execution;
  72.  
  73. client_respawn = { player addEventHandler ["Respawn",{
  74.         {player addweapon _x} foreach startinggear;
  75.         waituntil {(player hasweapon "ACE_Earplugs" ) && (player hasweapon "ACE_GlassesLHD_glasses" ) };
  76.         [player] execFSM "x\ace\addons\sys_goggles\use_earplug.fsm";    //Wears Earplug
  77.         [player, "ACE_GlassesLHD_glasses"] execFSM "x\ace\addons\sys_goggles\use_glasses.fsm";          //Wear Glasses
  78. }];
  79. };
  80.  
  81. player call client_respawn;
  82.  
  83. if (!isServer && isNull player) then {
  84.         waitUntil {!isNull player};
  85.         waituntil {local player};
  86.         player call client_execution;
  87.         player call client_respawn;
  88.         player setpos (getmarkerpos "respawn_west");
  89. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement