Advertisement
PiZZADOX

Simple Clientinit

Nov 24th, 2015
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 2.40 KB | None | 0 0
  1. //
  2. client_execution = {
  3.         if (isplayer player) then
  4.         {
  5.                 waituntil {local player};
  6.                 player enableSimulation false;
  7.                 2003 CutText ["Initialising...", "BLACK"];
  8.                 //calculate time
  9.                 _future = time + 5;
  10.                 waitUntil {(time >= _future)};
  11.                 defaultloadoutinit = [player] spawn {
  12.                     _unit = _this select 0;
  13.                     removeAllWeapons _unit;
  14.                     removeAllItems _unit;
  15.                     clearMagazineCargo (unitBackpack _unit);
  16.                     [_unit, "ALL"] call ACE_fnc_RemoveGear;
  17.                     {_unit addweapon _x} foreach startinggear;
  18.                     [_unit] execFSM "x\ace\addons\sys_goggles\use_earplug.fsm";
  19.                     [_unit, "ACE_GlassesLHD_glasses"] execFSM "x\ace\addons\sys_goggles\use_glasses.fsm";
  20.                 };
  21.                 ace_sys_tracking_markers_enabled = false;
  22.                 ace_sys_eject_fnc_weaponcheck = {};
  23.                 setViewDistance 1609;
  24.                 setTerrainGrid 50;
  25.                 onMapSingleClick {_shift};
  26.                 player setskill 0;
  27.                 player setVariable ["BIS_noCoreConversations", true];
  28.                 enableRadio false;
  29.                 {player disableAI _x} foreach ["MOVE","ANIM","TARGET","AUTOTARGET"];
  30.                 [] call (compile (preprocessFileLineNumbers ("\ca\Modules\MP\data\scripts\MPframework.sqf")));
  31.                 waitUntil { scriptDone defaultloadoutinit };
  32.                 titleFadeOut 0.1;
  33.                 2003 CutText ["Initialisation Completed", "BLACK IN", 5];
  34.                 diag_log format ["Mission Initialisation Completed for: %1 at: %2", player, time];
  35.                 player enablesimulation true;
  36.                 player addEventHandler ["Respawn",{
  37.                     _unit = _this select 0;
  38.                     removeAllWeapons _unit;
  39.                     removeAllItems _unit;
  40.                     clearMagazineCargo (unitBackpack _unit);
  41.                     [_unit, "ALL"] call ACE_fnc_RemoveGear;
  42.                     {_unit addweapon _x} foreach startinggear;
  43.                     [_unit] execFSM "x\ace\addons\sys_goggles\use_earplug.fsm";
  44.                     [_unit, "ACE_GlassesLHD_glasses"] execFSM "x\ace\addons\sys_goggles\use_glasses.fsm";
  45.                 }];
  46.                 [] spawn {
  47.                     sleep 5;
  48.                     [str ("Template"), str("Chernarus"), str(date select 1) + "." + str(date select 2) + "." + str(date select 0)] spawn BIS_fnc_infoText;
  49.                 };
  50.         };
  51. };
  52.  
  53. player call client_execution;
  54.  
  55.  
  56.  
  57. if (!isServer && isNull player) then {
  58.         waitUntil {!isNull player};
  59.         waituntil {local player};
  60.         player call client_execution;
  61.         player setpos (getmarkerpos "respawn_west");
  62. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement