SHARE
TWEET

ExileServer_object_player_createBambi.sqf

a guest May 24th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * ExileServer_object_player_createBambi
  3.  *
  4.  * Exile Mod
  5.  * www.exilemod.com
  6.  * © 2015 Exile Mod Team
  7.  *
  8.  * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
  9.  * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
  10.  */
  11.  
  12. private["_sessionID", "_requestingPlayer", "_spawnLocationMarkerName", "_bambiPlayer", "_accountData", "_escapeEnabled", "_direction", "_position", "_spawnAreaPosition", "_spawnAreaRadius", "_clanID", "_clanData", "_clanGroup", "_escapeAccountdata", "_devFriendlyMode", "_devs", "_parachuteNetID", "_spawnType", "_parachuteObject"];
  13. _sessionID = _this select 0;
  14. _requestingPlayer = _this select 1;
  15. _spawnLocationMarkerName = _this select 2;
  16. _bambiPlayer = _this select 3;
  17. _accountData = _this select 4;
  18. _escapeEnabled = getNumber(configFile >> "CfgSettings" >> "Escape" >> "enableEscape") isEqualTo 1;
  19. _direction = random 360;
  20. if (_escapeEnabled) then
  21. {
  22.     _position = getArray(configFile >> "CfgSettings" >> "Escape" >> worldName >> "startingLocation");
  23.     (uniformContainer _bambiPlayer) call ExileClient_util_containerCargo_clear;
  24.     _bambiPlayer linkItem "ItemGPS";
  25. }
  26. else
  27. {
  28.     if ((count ExileSpawnZoneMarkerPositions) isEqualTo 0) then
  29.     {
  30.         _position = call ExileClient_util_world_findCoastPosition;
  31.         if ((toLower worldName) isEqualTo "namalsk") then
  32.         {
  33.             while {(_position distance2D [76.4239, 107.141, 0]) < 100} do
  34.             {
  35.                 _position = call ExileClient_util_world_findCoastPosition;
  36.             };
  37.         };
  38.     }
  39.     else
  40.     {
  41.         _spawnAreaPosition = getMarkerPos _spawnLocationMarkerName;
  42.         _spawnAreaRadius = getNumber(configFile >> "CfgSettings" >> "BambiSettings" >> "spawnZoneRadius");
  43.         _position = [_spawnAreaPosition, _spawnAreaRadius] call ExileClient_util_math_getRandomPositionInCircle;
  44.         while {surfaceIsWater _position} do
  45.         {
  46.             _position = [_spawnAreaPosition, _spawnAreaRadius] call ExileClient_util_math_getRandomPositionInCircle;
  47.         };
  48.     };
  49. };
  50. _name = name _requestingPlayer;
  51. _clanID = (_accountData select 3);
  52. if !((typeName _clanID) isEqualTo "SCALAR") then
  53. {
  54.     _clanID = -1;
  55.     _clanData = [];
  56. }
  57. else
  58. {
  59.     _clanData = missionNamespace getVariable [format ["ExileServer_clan_%1",_clanID],[]];
  60.     if(isNull (_clanData select 5))then
  61.     {
  62.         _clanGroup = createGroup independent;
  63.         _clanData set [5,_clanGroup];
  64.         _clanGroup setGroupIdGlobal [_clanData select 0];
  65.         missionNameSpace setVariable [format ["ExileServer_clan_%1",_clanID],_clanData];
  66.     }
  67.     else
  68.     {
  69.         _clanGroup = (_clanData select 5);
  70.     };
  71.     [_bambiPlayer] joinSilent _clanGroup;
  72. };
  73. _bambiPlayer setPosATL [_position select 0,_position select 1,0];
  74. _bambiPlayer disableAI "FSM";
  75. _bambiPlayer disableAI "MOVE";
  76. _bambiPlayer disableAI "AUTOTARGET";
  77. _bambiPlayer disableAI "TARGET";
  78. _bambiPlayer disableAI "CHECKVISIBLE";
  79. _bambiPlayer setDir _direction;
  80. _bambiPlayer setName _name;
  81. _bambiPlayer setVariable ["ExileMoney", 0, true];
  82. _bambiPlayer setVariable ["ExileScore", (_accountData select 0)];
  83. _bambiPlayer setVariable ["ExileKills", (_accountData select 1)];
  84. _bambiPlayer setVariable ["ExileDeaths", (_accountData select 2)];
  85. _bambiPlayer setVariable ["ExileClanID", _clanID];
  86. _bambiPlayer setVariable ["ExileClanData", _clanData];
  87. _bambiPlayer setVariable ["ExileHunger", 100];
  88. _bambiPlayer setVariable ["ExileThirst", 100];
  89. _bambiPlayer setVariable ["ExileTemperature", 37];
  90. _bambiPlayer setVariable ["ExileWetness", 0];
  91. _bambiPlayer setVariable ["ExileAlcohol", 0];
  92. _bambiPlayer setVariable ["ExileName", _name];
  93. _bambiPlayer setVariable ["ExileOwnerUID", getPlayerUID _requestingPlayer];
  94. _bambiPlayer setVariable ["ExileIsBambi", !_escapeEnabled];
  95. _bambiPlayer setVariable ["ExileXM8IsOnline", false, true];
  96. _bambiPlayer setVariable ["ExileLocker", (_accountData select 4), true];
  97. if (_escapeEnabled) then
  98. {
  99.     _escapeAccountdata = format["getEscapeAccountStats:%1", getPlayerUID _requestingPlayer] call ExileServer_system_database_query_selectSingle;
  100.     _bambiPlayer setVariable ["ExileWins", (_escapeAccountdata select 0)];
  101.     _bambiPlayer setVariable ["ExileMatches", (_escapeAccountdata select 1)];
  102. };
  103. _devFriendlyMode = getNumber (configFile >> "CfgSettings" >> "ServerSettings" >> "devFriendyMode");
  104. if (_devFriendlyMode isEqualTo 1) then
  105. {
  106.     _devs = getArray (configFile >> "CfgSettings" >> "ServerSettings" >> "devs");
  107.     {
  108.         if ((getPlayerUID _requestingPlayer) isEqualTo (_x select 0))exitWith
  109.         {
  110.             if ((name _requestingPlayer) isEqualTo (_x select 1))then
  111.             {
  112.                 _bambiPlayer setVariable ["ExileMoney", 500000, true];
  113.                 _bambiPlayer setVariable ["ExileScore", 100000];
  114.             };
  115.         };
  116.     }
  117.     forEach _devs;
  118. };
  119. _parachuteNetID = "";
  120. if ((getNumber(configFile >> "CfgSettings" >> "BambiSettings" >> "parachuteSpawning")) isEqualTo 1 && {!(_escapeEnabled)}) then
  121. {
  122.     _position set [2, getNumber(configFile >> "CfgSettings" >> "BambiSettings" >> "parachuteDropHeight")];
  123.     if ((getNumber(configFile >> "CfgSettings" >> "BambiSettings" >> "haloJump")) isEqualTo 1) then
  124.     {
  125.         _bambiPlayer addBackpackGlobal "B_Parachute";
  126.         _bambiPlayer setPosATL _position;
  127.         _spawnType = 2;
  128.     }
  129.     else
  130.     {
  131.         _parachuteObject = createVehicle ["Steerable_Parachute_F", _position, [], 0, "CAN_COLLIDE"];
  132.         _parachuteObject setDir _direction;
  133.         _parachuteObject setPosATL _position;
  134.         _parachuteObject enableSimulationGlobal true;
  135.         _parachuteNetID = netId _parachuteObject;
  136.         _spawnType = 1;
  137.     };
  138. }
  139. else
  140. {
  141.     _spawnType = 0;
  142. };
  143.  
  144. /////////////////////////////////////////////
  145. ///// Respect based loadouts start here /////
  146. /////////////////////////////////////////////
  147.  
  148. _respect = (_accountData select 0);
  149.  
  150. switch (true) do
  151. {
  152.    case (_Respect > 0 && _Respect < 2500):
  153.    
  154.     //Bambi
  155.     {
  156.     _bambiPlayer forceAddUniform "Exile_Uniform_BambiOverall";
  157.     _bambiplayer addItem "Exile_Item_Moobar";
  158.     _bambiplayer addItem "Exile_Item_ChocolateMilk";
  159.     };
  160.    
  161.    case (_respect > 2500 && _respect < 4999):
  162.     {
  163.     _bambiPlayer forceAddUniform "U_C_Poor_shorts_1";
  164.     _bambiPlayer addVest "V_Rangemaster_belt";
  165.     _bambiPlayer addItem "Exile_Item_Moobar";
  166.     _bambiPlayer addItem "Exile_Item_ChocolateMilk";
  167.     _bambiPlayer addWeaponGlobal "hgun_Pistol_01_F";
  168.     _bambiPlayer addMagazine "10Rnd_9x21_Mag";
  169.    
  170.     //systemChat "Your rank is Enforcer";
  171.     };
  172.  
  173.   case (_respect > 5000 && _respect < 9999):
  174.    {
  175.     _bambiPlayer forceAddUniform "U_C_Poloshirt_redwhite";
  176.     _bambiplayer addHeadGear "H_Bandanna_khk";
  177.     _bambiPlayer addVest "V_BandollierB_khk";
  178.     _bambiPlayer addItem "Exile_Item_Moobar";
  179.     _bambiPlayer addItem "Exile_Item_ChocolateMilk";
  180.     _bambiPlayer addWeaponGlobal "hgun_Pistol_01_F";
  181.     _bambiPlayer addMagazine "10Rnd_9x21_Mag";
  182.    
  183.     //systemChat "Your rank is Slayer";
  184.    };
  185.  
  186.   case (_respect > 9999 && _respect < 19999):
  187.    {
  188.     _bambiPlayer forceAddUniform "U_Competitor";
  189.     _bambiplayer addHeadGear "H_Hat_blue"; 
  190.     _bambiPlayer addVest "V_BandollierB_oli";
  191.     _bambiPlayer addBackpack "B_TacticalPack_mcamo";
  192.     _bambiPlayer addWeaponGlobal "hgun_Pistol_heavy_02_F";
  193.     _bambiPlayer addMagazine "6Rnd_45ACP_Cylinder";
  194.     _bambiplayer addItem "Exile_Item_Bandage";
  195.     _bambiplayer addItem "Exile_Item_Raisins";
  196.     _bambiplayer addItem "Exile_Item_MountainDupe";
  197.    
  198.     //systemChat "Your rank is Hitman";
  199.    };
  200.  
  201.   case (_respect > 19999 && _respect < 29999):
  202.    {
  203.     _bambiPlayer forceAddUniform "U_Rangermaster";
  204.     for "_i" from 1 to 2 do {_bambiPlayer addItemToUniform "6Rnd_45ACP_Cylinder";};
  205.     _bambiPlayer addHeadgear "H_Booniehat_dgtl";
  206.     _bambiPlayer addVest "V_BandollierB_rgr";
  207.     _bambiPlayer addBackpack "B_TacticalPack_mcamo";
  208.     _bambiPlayer addWeaponGlobal "hgun_Pistol_heavy_02_F";
  209.     _bambiPlayer addMagazine "6Rnd_45ACP_Cylinder";
  210.     _bambiplayer addItem "Exile_Item_EnergyDrink";
  211.     _bambiplayer addItem "Exile_Item_Noodles";
  212.     _bambiPlayer addItem "Exile_Item_Vishpirin";
  213.     _bambiplayer addItem "Exile_Item_Bandage";
  214.    
  215.     //systemChat "Your rank is Executioner";
  216.    };
  217.  
  218.   case (_respect > 29999 && _respect < 39999):
  219.    {
  220.     _bambiPlayer forceAddUniform "U_C_HunterBody_grn";
  221.     for "_i" from 1 to 2 do {_bambiPlayer addItemToUniform "10Rnd_9x21_Mag";}; 
  222.     _bambiPlayer addHeadgear "H_Booniehat_dgtl";
  223.     _bambiPlayer addVest "V_BandollierB_oli";
  224.     _bambiPlayer addWeaponGlobal "hgun_ACPC2_F";
  225.     _bambiPlayer addMagazine "10Rnd_9x21_Mag";
  226.     _bambiPlayer addBackpack "B_Bergen_mcamo";
  227.     _bambiPlayer addItem "Exile_Item_Vishpirin";
  228.     _bambiplayer addItem "Exile_Item_Bandage";
  229.     _bambiplayer addItem "Exile_Item_BeefParts";
  230.     _bambiplayer addItem "Exile_Item_EnergyDrink";
  231.     _bambiplayer addItem "Exile_Item_DuctTape";
  232.  
  233.     //systemChat "Your rank is Tyrant";
  234.    };
  235.  
  236.   case (_respect > 39999 && _respect < 49999):
  237.    {
  238.     _bambiPlayer forceAddUniform "U_C_WorkerCoveralls";
  239.     for "_i" from 1 to 2 do {_bambiPlayer addItemToUniform "10Rnd_9x21_Mag";};
  240.     _bambiPlayer addHeadgear "Exile_Headgear_SafetyHelmet";
  241.     _bambiPlayer addVest "V_BandollierB_rgr";
  242.     _bambiPlayer addWeaponGlobal "hgun_ACPC2_F";
  243.     _bambiPlayer addMagazine "10Rnd_9x21_Mag";
  244.     _bambiPlayer addBackpack "B_Bergen_mcamo";
  245.     _bambiPlayer addItemToVest "Exile_Item_PowerDrink";
  246.     _bambiPlayer addItemToVest "Exile_Item_BeefParts";
  247.     _bambiPlayer addItem "Exile_Item_DuctTape";
  248.     _bambiPlayer addItem "Exile_Item_InstaDoc";
  249.          
  250.     //systemChat "Your rank is Triggerman";
  251.    };
  252.  
  253.   case (_respect > 49999 && _respect < 69999):
  254.    {
  255.     //_bambiPlayer forceAddUniform "U_I_G_resistanceLeader_F";
  256.     _bambiPlayer forceAddUniform "U_I_G_Story_Protagonist_F";
  257.     for "_i" from 1 to 2 do {_bambiPlayer addItemToUniform "30Rnd_9x21_Mag_SMG_02";};
  258.     _bambiPlayer addHeadgear "H_Cap_oli_hs";
  259.     _bambiPlayer addVest "V_HarnessO_gry";
  260.     _bambiPlayer addWeaponGlobal "SMG_05_F";
  261.     _bambiPlayer addMagazine "30Rnd_9x21_Mag_SMG_02";
  262.     _bambiplayer addBackpack "B_OutdoorPack_blu";
  263.     _bambiplayer addItem "Exile_Item_PowerDrink";
  264.     _bambiplayer addItem "Exile_Item_Bandage";
  265.     _bambiplayer addItem "Exile_Item_GloriousKnakworst";
  266.     _bambiplayer addItem "Exile_Item_CanOpener";
  267.     _bambiplayer addItem "Exile_Item_DuctTape";
  268.     _bambiPlayer addItem "Exile_Item_InstaDoc";
  269.  
  270.     //systemChat "Your rank is Trooper";
  271.    };
  272.  
  273.   case (_respect > 69999 && _respect < 89999):
  274.    {
  275.     //_bambiPlayer forceAddUniform "U_B_survival_uniform";
  276.     _bambiPlayer forceAddUniform "U_BG_Guerilla3_1";
  277.     for "_i" from 1 to 2 do {_bambiPlayer addItemToUniform "20Rnd_556x45_UW_Mag";};
  278.     _bambiPlayer addHeadgear "H_ShemagOpen_tan";
  279.     _bambiPlayer addVest "V_HarnessO_gry";
  280.     _bambiPlayer addWeaponGlobal "arifle_sdar_f";
  281.     _bambiPlayer addMagazine "20Rnd_556x45_UW_Mag";
  282.     _bambiplayer addBackpack "B_TacticalPack_blk";
  283.     _bambiplayer addItem "Exile_Item_PowerDrink";
  284.     _bambiplayer addItem "Exile_Item_Bandage";
  285.     _bambiplayer addItem "Exile_Item_MacasCheese";
  286.     _bambiplayer addItem "Exile_Item_CanOpener";
  287.     _bambiplayer addItem "Exile_Item_DuctTape";
  288.     _bambiPlayer addItem "Exile_Item_InstaDoc";
  289.     _bambiPlayer linkItem "ItemGPS";
  290.    
  291.     //systemChat "Your rank is High Executioner";
  292.    };
  293.  
  294.   case (_respect > 89999 && _respect < 149999):
  295.    {
  296.     _bambiPlayer forceAddUniform "U_BG_Guerrilla_6_1";
  297.     for "_i" from 1 to 2 do {_bambiPlayer addItemToUniform "30Rnd_556x45_Stanag";};
  298.     _bambiPlayer addHeadgear "H_Booniehat_oli";
  299.     _bambiPlayer addVest "V_HarnessO_gry";
  300.     _bambiPlayer addWeaponGlobal "arifle_AKS_F";
  301.     _bambiPlayer addPrimaryWeaponItem "optic_Aco_smg";
  302.     _bambiPlayer addPrimaryWeaponItem "acc_flashlight";
  303.     _bambiPlayer addMagazine "30Rnd_556x45_Stanag";
  304.     _bambiPlayer addBackpack "B_Kitbag_rgr";
  305.     _bambiPlayer addItem "Exile_Item_PlasticBottleFreshWater";
  306.     _bambiplayer addItem "Exile_Item_Bandage";
  307.     _bambiplayer addItem "Exile_Item_MacasCheese";
  308.     _bambiplayer addItem "Exile_Item_CanOpener";
  309.     _bambiplayer addItem "Exile_Item_DuctTape";
  310.     _bambiPlayer addItem "Exile_Item_InstaDoc";
  311.     _bambiPlayer linkItem "ItemGPS";
  312.      
  313.     //systemChat "Your rank is Reaper";
  314.    };
  315.  
  316.   case (_respect > 149999):
  317.    {
  318.      //_bambiPlayer forceAddUniform "Exile_Uniform_Woodland";
  319.     _bambiPlayer forceAddUniform "U_I_CombatUniform_shortsleeve";
  320.     for "_i" from 1 to 2 do {_bambiPlayer addItemToUniform "30Rnd_762x39_mag_tracer_F";};
  321.     _bambiplayer addHeadGear "H_Watchcap_blk";
  322.     _bambiPlayer addVest "V_TacChestrig_grn_F";
  323.     _bambiPlayer addWeaponGlobal "arifle_MX_Black_F";
  324.     _bambiPlayer addPrimaryWeaponItem "optic_Aco_smg";
  325.     _bambiPlayer addMagazine "30Rnd_762x39_Mag_F";
  326.     _bambiPlayer addBackpack "B_Kitbag_rgr";
  327.     _bambiPlayer addItem "Exile_Item_PlasticBottleFreshWater";
  328.     _bambiplayer addItem "Exile_Item_Bandage";
  329.     _bambiplayer addItem "Exile_Item_BBQSandwich_Cooked";
  330.     _bambiplayer addItem "Exile_Item_CanOpener";
  331.     _bambiplayer addItem "Exile_Item_DuctTape";
  332.     _bambiPlayer addItem "Exile_Item_InstaDoc";
  333.     _bambiPlayer addItem "Exile_Item_Vishpirin";
  334.     _bambiPlayer linkItem "ItemGPS";
  335.     _bambiPlayer addWeapon "NVGoggles";
  336.    
  337.     //systemChat "Your rank is Supreme Overlord";
  338.    };
  339.     default
  340.     {
  341.     };
  342. };
  343.  
  344. /////////////////////////////////////////////
  345. ///// Respect based loadouts end here   /////
  346. /////////////////////////////////////////////
  347.  
  348. if (getNumber(missionConfigFile >> "CfgSimulation" >> "enableDynamicSimulation") isEqualTo 1) then
  349. {
  350.     if ((canTriggerDynamicSimulation _bambiPlayer) isEqualTo false) then
  351.     {
  352.         _bambiPlayer triggerDynamicSimulation true;
  353.         _bambiPlayer enableDynamicSimulation true;
  354.     };
  355. };
  356. _bambiPlayer addMPEventHandler ["MPKilled", {_this call ExileServer_object_player_event_onMpKilled}];
  357. if !(_escapeEnabled) then
  358. {
  359.     _bambiPlayer call ExileServer_object_player_database_insert;
  360.     _bambiPlayer call ExileServer_object_player_database_update;
  361. };
  362. [
  363.     _sessionID,
  364.     "createPlayerResponse",
  365.     [
  366.         _bambiPlayer,
  367.         _parachuteNetID,
  368.         str (_accountData select 0),
  369.         (_accountData select 1),
  370.         (_accountData select 2),
  371.         100,
  372.         100,
  373.         0,
  374.         (getNumber (configFile >> "CfgSettings" >> "BambiSettings" >> "protectionDuration")) * 60,
  375.         _clanData,
  376.         _spawnType
  377.     ]
  378. ]
  379. call ExileServer_system_network_send_to;
  380. if (_escapeEnabled) then
  381. {
  382.     [
  383.         _sessionID,
  384.         "escapeVariables",
  385.         [
  386.             (_escapeAccountdata select 0),
  387.             (_escapeAccountdata select 1)
  388.         ]
  389.     ]
  390.     call ExileServer_system_network_send_to;
  391. };
  392. [_sessionID, _bambiPlayer] call ExileServer_system_session_update;
  393. true
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top