Advertisement
jimbouk1977

ExileServer_object_player_createBambi.sqf

Apr 8th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 8.13 KB | None | 0 0
  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","_direction","_position","_spawnAreaPosition","_spawnAreaRadius","_clanID","_clanData","_clanGroup","_player","_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. _direction = random 360;
  19. if ((count ExileSpawnZoneMarkerPositions) isEqualTo 0) then
  20. {
  21.     _position = call ExileClient_util_world_findCoastPosition;
  22.     if ((toLower worldName) isEqualTo "namalsk") then
  23.     {
  24.         while {(_position distance2D [76.4239, 107.141, 0]) < 100} do
  25.         {
  26.             _position = call ExileClient_util_world_findCoastPosition;
  27.         };
  28.     };
  29. }
  30. else
  31. {
  32.     _spawnAreaPosition = getMarkerPos _spawnLocationMarkerName;
  33.     _spawnAreaRadius = getNumber(configFile >> "CfgSettings" >> "BambiSettings" >> "spawnZoneRadius");
  34.     _position = [_spawnAreaPosition, _spawnAreaRadius] call ExileClient_util_math_getRandomPositionInCircle;
  35.     while {surfaceIsWater _position} do
  36.     {
  37.         _position = [_spawnAreaPosition, _spawnAreaRadius] call ExileClient_util_math_getRandomPositionInCircle;
  38.     };
  39. };
  40. _name = name _requestingPlayer;
  41. _clanID = (_accountData select 3);
  42. if !((typeName _clanID) isEqualTo "SCALAR") then
  43. {
  44.     _clanID = -1;
  45.     _clanData = [];
  46. }
  47. else
  48. {
  49.     _clanData = missionNamespace getVariable [format ["ExileServer_clan_%1",_clanID],[]];
  50.     if(isNull (_clanData select 5))then
  51.     {
  52.         _clanGroup = createGroup independent;
  53.         _clanData set [5,_clanGroup];
  54.         _clanGroup setGroupIdGlobal [_clanData select 0];
  55.         missionNameSpace setVariable [format ["ExileServer_clan_%1",_clanID],_clanData];
  56.     }
  57.     else
  58.     {
  59.         _clanGroup = (_clanData select 5);
  60.     };
  61.     [_player] joinSilent _clanGroup;
  62. };
  63. _bambiPlayer setPosATL [_position select 0,_position select 1,0];
  64. _bambiPlayer disableAI "FSM";
  65. _bambiPlayer disableAI "MOVE";
  66. _bambiPlayer disableAI "AUTOTARGET";
  67. _bambiPlayer disableAI "TARGET";
  68. _bambiPlayer disableAI "CHECKVISIBLE";
  69. _bambiPlayer setDir _direction;
  70. _bambiPlayer setName _name;
  71. _bambiPlayer setVariable ["ExileMoney", 0, true];
  72. _bambiPlayer setVariable ["ExileScore", (_accountData select 0)];
  73. _bambiPlayer setVariable ["ExileKills", (_accountData select 1)];
  74. _bambiPlayer setVariable ["ExileDeaths", (_accountData select 2)];
  75. _bambiPlayer setVariable ["ExileClanID", _clanID];
  76. _bambiPlayer setVariable ["ExileClanData", _clanData];
  77. _bambiPlayer setVariable ["ExileHunger", 100];
  78. _bambiPlayer setVariable ["ExileThirst", 100];
  79. _bambiPlayer setVariable ["ExileTemperature", 37];
  80. _bambiPlayer setVariable ["ExileWetness", 0];
  81. _bambiPlayer setVariable ["ExileAlcohol", 0];
  82. _bambiPlayer setVariable ["ExileName", _name];
  83. _bambiPlayer setVariable ["ExileOwnerUID", getPlayerUID _requestingPlayer];
  84. _bambiPlayer setVariable ["ExileIsBambi", true];
  85. _bambiPlayer setVariable ["ExileXM8IsOnline", false, true];
  86. _bambiPlayer setVariable ["ExileLocker", (_accountData select 4), true];
  87. _devFriendlyMode = getNumber (configFile >> "CfgSettings" >> "ServerSettings" >> "devFriendyMode");
  88. if (_devFriendlyMode isEqualTo 1) then
  89. {
  90.     _devs = getArray (configFile >> "CfgSettings" >> "ServerSettings" >> "devs");
  91.     {
  92.         if ((getPlayerUID _requestingPlayer) isEqualTo (_x select 0))exitWith
  93.         {
  94.             if((name _requestingPlayer) isEqualTo (_x select 1))then
  95.             {
  96.                 _bambiPlayer setVariable ["ExileMoney", 500000, true];
  97.                 _bambiPlayer setVariable ["ExileScore", 100000];
  98.             };
  99.         };
  100.     }
  101.     forEach _devs;
  102. };
  103. _parachuteNetID = "";
  104. if ((getNumber(configFile >> "CfgSettings" >> "BambiSettings" >> "parachuteSpawning")) isEqualTo 1) then
  105. {
  106.     _position set [2, getNumber(configFile >> "CfgSettings" >> "BambiSettings" >> "parachuteDropHeight")];
  107.     if ((getNumber(configFile >> "CfgSettings" >> "BambiSettings" >> "haloJump")) isEqualTo 1) then
  108.     {
  109.         _bambiPlayer addBackpackGlobal "B_Parachute";
  110.         _bambiPlayer setPosATL _position;
  111.         _spawnType = 2;
  112.     }
  113.     else
  114.     {
  115.         _parachuteObject = createVehicle ["Steerable_Parachute_F", _position, [], 0, "CAN_COLLIDE"];
  116.         _parachuteObject setDir _direction;
  117.         _parachuteObject setPosATL _position;
  118.         _parachuteObject enableSimulationGlobal true;
  119.         _parachuteNetID = netId _parachuteObject;
  120.         _spawnType = 1;
  121.     };
  122. }
  123. else
  124. {
  125.     _spawnType = 0;
  126. };
  127.  
  128. // Custom Loadout Starts Here. Uncomment the lines you want your players to have..
  129.  
  130.     // Remove Anything already on the BambiSettings
  131.     removeAllAssignedItems _bambiPlayer;
  132.     removeGoggles _bambiPlayer;
  133.     removeHeadgear _bambiPlayer;
  134.     removeUniform _bambiPlayer;
  135.     //removeBackpackGlobal _bambiPlayer; // Only Uncomment This if Not Using Paracutes
  136.    
  137.     // Clothing
  138.     _bambiPlayer forceAddUniform "Exile_Uniform_ExileCustoms"; // Black Exile Overalls
  139.     _bambiPlayer addVest "V_Rangemaster_belt"; // Change Vest Class Here
  140.     //_bambiPlayer addHeadgear "H_Beret_gen_F"; // Change Headgear Class Here
  141.     //_bambiPlayer addBackpack "B_ViperHarness_blk_F"; // Change Backpack Class Here
  142.    
  143.     // equipment / Items
  144.     _bambiPlayer addItem "Exile_Item_DuctTape"; // Change what items you want to spawn with here
  145.     //_bambiPlayer addItem "Exile_Item_DuctTape"; // Change what items you want to spawn with here
  146.     //_bambiPlayer addItem "Exile_Item_DuctTape"; // Change what items you want to spawn with here
  147.    
  148.     // Navigation Items
  149.     _bambiPlayer linkItem "ItemGPS"; // This Puts The GPS Into The Correct Slot
  150.     _bambiPlayer linkItem "Exile_Item_XM8"; // This Puts The XM8 Into The Correct Slot
  151.     _bambiPlayer linkItem "ItemCompass"; //This Puts The Compass Into The Correct Slot
  152.     _bambiPlayer linkItem "ItemMap"; //This Puts The Map Into The Correct Slot
  153.     _bambiPlayer linkItem "ItemRadio"; //This Puts The Radio Into The Correct Slot
  154.    
  155.     // Food and Drink Items
  156.     _bambiPlayer addItem "Exile_Item_PlasticBottleCoffee"; // Change Drink Class Here
  157.     _bambiPlayer addItem "Exile_Item_DsNuts"; // Change Food Class Here
  158.    
  159.     // Medical Items
  160.     _bambiPlayer addItem "Exile_Item_Vishpirin"; // Change Meds Class Here
  161.     //_bambiPlayer addItem "Exile_Item_Bandage"; // Change Meds Class Here
  162.     //_bambiPlayer addItem "Exile_Item_InstaDoc"; // Change Meds Class Here
  163.    
  164.     // Ammo - Add ammo before weapons
  165.     _bambiPlayer addItemToVest "30Rnd_9x21_Mag"; // Ammo For Weapon Listed Below
  166.     _bambiPlayer addItemToVest "30Rnd_9x21_Mag"; // Ammo For Weapon Listed Below
  167.     //_bambiPlayer addItemToVest "30Rnd_9x21_Mag"; // Ammo For Weapon Listed Below
  168.    
  169.     // Weapons
  170.     _bambiPlayer addWeapon "hgun_PDW2000_F"; // Weapon
  171.    
  172.     // Weapons Attachments
  173.     //_bambiPlayer addHandgunItem "optic_MRD"; // Adds Attachment to Handgun | Change Attachment Class Here
  174.     //_bambiPlayer addHandgunItem "muzzle_snds_acp"; // Adds Attachment to Handgun | Change Attachment Class Here
  175.     //_bambiPlayer addPrimaryWeaponItem "optic_AMS_khk"; // Adds Attachment to Primary Weapon | Change Attachment Class Here
  176.     //_bambiPlayer addPrimaryWeaponItem "bipod_03_F_oli";// Adds Attachment to Primary Weapon | Change Attachment Class Here
  177.     //_bambiPlayer addPrimaryWeaponItem "muzzle_snds_B_khk_F"; // Adds Attachment to Primary Weapon | Change Attachment Class Here
  178.    
  179. // Custom Loadout Ends Here. Uncomment the lines you want your players to have..
  180.  
  181. _bambiPlayer addMPEventHandler ["MPKilled", {_this call ExileServer_object_player_event_onMpKilled}];
  182. _bambiPlayer call ExileServer_object_player_database_insert;
  183. _bambiPlayer call ExileServer_object_player_database_update;
  184. [
  185.     _sessionID,
  186.     "createPlayerResponse",
  187.     [
  188.         _bambiPlayer,
  189.         _parachuteNetID,
  190.         str (_accountData select 0),
  191.         (_accountData select 1),
  192.         (_accountData select 2),
  193.         100,
  194.         100,
  195.         0,
  196.         (getNumber (configFile >> "CfgSettings" >> "BambiSettings" >> "protectionDuration")) * 60,
  197.         _clanData,
  198.         _spawnType
  199.     ]
  200. ]
  201. call ExileServer_system_network_send_to;
  202. [_sessionID, _bambiPlayer] call ExileServer_system_session_update;
  203. true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement