darkstaride

init-client.sqf

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