SHARE
TWEET

ExileServer_object_player_createBambi

a guest Sep 25th, 2016 167 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","_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.  
  105. if ((getNumber(configFile >> "CfgSettings" >> "BambiSettings" >> "parachuteSpawning")) isEqualTo 1) then
  106. {
  107.  _position set [2, getNumber(configFile >> "CfgSettings" >> "BambiSettings" >> "parachuteDropHeight")];
  108.  if ((getNumber(configFile >> "CfgSettings" >> "BambiSettings" >> "haloJump")) isEqualTo 1) then
  109.  {
  110.   _bambiPlayer addBackpackGlobal "B_Parachute";
  111.   _bambiPlayer setPosATL _position;
  112.   _spawnType = 2;
  113.  }
  114.  else
  115.  {
  116.   _parachuteObject = createVehicle ["Steerable_Parachute_F", _position, [], 0, "CAN_COLLIDE"];
  117.   _parachuteObject setDir _direction;
  118.   _parachuteObject setPosATL _position;
  119.   _parachuteObject enableSimulationGlobal true;
  120.   _parachuteNetID = netId _parachuteObject;
  121.   _spawnType = 1;
  122.  };
  123. }
  124. else
  125. {
  126.  _spawnType = 0;
  127. };
  128.  
  129. _respect = (_accountData select 0);
  130.  
  131. switch (true) do
  132. {
  133.     case (_respect > 2500 && _respect < 4999):
  134.     {
  135.  _bambiPlayer forceAddUniform "U_C_Poloshirt_redwhite";
  136.  _bambiPlayer addVest "V_BandollierB_oli";
  137.  //_bambiPlayer addItemToVest "Exile_Melee_Axe";
  138.  _bambiPlayer addItemToVest "Exile_Magazine_Swing";
  139.  ///_bambiPlayer addBackpack "B_AssaultPack_Kerry";
  140.  _bambiPlayer addItem "Exile_Item_Matches";
  141.  _bambiPlayer addItem "Exile_Item_Foolbox";
  142.  _bambiPlayer linkItem "ItemGPS";
  143.  _bambiPlayer addWeaponGlobal "Exile_Melee_Axe";
  144.  //_bambiPlayer addMagazine "Exile_Magazine_Swing";
  145.     systemChat "Your rank is Enforcer";
  146.   };
  147.  
  148.     case (_respect > 5000 && _respect < 9999):
  149.    {
  150.  _bambiPlayer forceAddUniform "U_Competitor";
  151.  _bambiPlayer addVest "V_BandollierB_oli";
  152.  //_bambiPlayer addItemToVest "Exile_Melee_Axe";
  153.  _bambiPlayer addItemToVest "Exile_Magazine_Swing";
  154.  //_bambiPlayer addBackpack "B_AssaultPack_Kerry";
  155.  _bambiPlayer addItem "Exile_Item_Foolbox";
  156.  _bambiPlayer addItem "Exile_Item_Matches";
  157.  _bambiPlayer linkItem "ItemGPS";
  158.  _bambiPlayer addWeaponGlobal "Exile_Melee_Axe";
  159.  //_bambiPlayer addMagazine "Exile_Magazine_Swing";
  160.  _bambiPlayer addItem "Exile_Item_PlasticBottleFreshWater";
  161.  
  162.   systemChat "Your rank is Slayer";
  163.    };
  164.  
  165.  case (_respect > 9999 && _respect < 19999):
  166.    {
  167.  _bambiPlayer forceAddUniform "U_Rangermaster";
  168.  _bambiPlayer addHeadgear "H_Booniehat_dgtl";
  169.  _bambiPlayer addVest "V_BandollierB_oli";
  170.  //_bambiPlayer addItemToVest "Exile_Melee_Axe";
  171.  _bambiPlayer addItemToVest "Exile_Magazine_Swing";
  172.  //_bambiPlayer addBackpack "B_TacticalPack_mcamo";
  173.  _bambiPlayer addItem "Exile_Item_Foolbox";
  174.  _bambiPlayer addItem "Exile_Item_Matches";
  175.  _bambiPlayer linkItem "ItemGPS";
  176.  _bambiPlayer addWeaponGlobal "Exile_Melee_Axe";
  177.  //_bambiPlayer addMagazine "Exile_Magazine_Swing";
  178.  _bambiPlayer addItem "Exile_Item_EMRE";
  179.  _bambiPlayer addItem "Exile_Item_PlasticBottleFreshWater";
  180.  _bambiPlayer addItem "Exile_Item_InstaDoc";
  181.   systemChat "Your rank is Hit Man";
  182.    };
  183.  
  184.     case (_respect > 19999 && _respect < 29999):
  185.    {
  186.  _bambiPlayer forceAddUniform "U_B_CombatUniform_mcam_worn";
  187.  for "_i" from 1 to 2 do {_bambiPlayer addItemToUniform "17Rnd_mas_9x21_Mag";};
  188.  _bambiPlayer addVest "TRYK_V_Sheriff_BA_T5";
  189.  //_bambiPlayer addBackpack "B_Bergen_mcamo";
  190.  _bambiPlayer addHeadgear "H_Booniehat_dgtl";
  191.  _bambiPlayer addItemToVest "hgun_mas_grach_F";
  192.  _bambiPlayer addItemToVest "acc_mas_flash_gun";
  193.  //_bambiPlayer addItemToVest "Exile_Melee_Axe";
  194.  _bambiPlayer addItemToVest "Exile_Magazine_Swing";
  195.   //_bambiPlayer addWeaponGlobal "hgun_mas_grach_F";
  196.  //_bambiPlayer addHandgunItem "acc_mas_flash_gun";
  197.  _bambiPlayer addItem "Exile_Item_Foolbox";
  198.  _bambiPlayer addItem "Exile_Item_Matches";
  199.  _bambiPlayer linkItem "ItemGPS";
  200.  _bambiPlayer addWeaponGlobal "Exile_Melee_Axe";
  201.  //_bambiPlayer addMagazine "Exile_Magazine_Swing";
  202.  _bambiPlayer addItem "Exile_Item_EMRE";
  203.  _bambiPlayer addItem "Exile_Item_PlasticBottleFreshWater";
  204.  _bambiPlayer addItem "Exile_Item_InstaDoc";
  205.   systemChat "Your rank is Executioner";
  206.    };
  207.  
  208.     case (_respect > 29999 && _respect < 39999):
  209.    {
  210.     _bambiPlayer forceAddUniform "U_C_HunterBody_grn";
  211.  for "_i" from 1 to 2 do {_bambiPlayer addItemToUniform "17Rnd_mas_9x21_Mag";};
  212.  _bambiPlayer addVest "TRYK_V_Sheriff_BA_T5";
  213.  //_bambiPlayer addBackpack "B_Bergen_mcamo";
  214.  _bambiPlayer addHeadgear "H_Booniehat_dgtl";
  215.  _bambiPlayer addItemToVest "hgun_mas_grach_F";
  216.  _bambiPlayer addItemToVest "acc_mas_flash_gun";
  217.  _bambiPlayer addItemToVest "optic_mas_MRD";
  218.  //_bambiPlayer addItemToVest "Exile_Melee_Axe";
  219.  _bambiPlayer addItemToVest "Exile_Magazine_Swing";
  220.  _bambiPlayer addItem "Exile_Item_Foolbox";
  221.   //_bambiPlayer addWeaponGlobal "hgun_mas_grach_F";
  222.  //_bambiPlayer addHandgunItem "acc_mas_flash_gun";
  223.  //_bambiPlayer addHandgunItem "optic_mas_MRD";
  224.  _bambiPlayer addItem "Exile_Item_Matches";
  225.  _bambiPlayer linkItem "ItemGPS";
  226.  _bambiPlayer addWeaponGlobal "Exile_Melee_Axe";
  227.  //_bambiPlayer addMagazine "Exile_Magazine_Swing";
  228.  _bambiPlayer addItem "Exile_Item_EMRE";
  229.  _bambiPlayer addItem "Exile_Item_PlasticBottleFreshWater";
  230.  _bambiPlayer addItem "Exile_Item_InstaDoc";
  231.  
  232.   systemChat "Your rank is Tyrant";
  233.    };
  234.  
  235.     case (_respect > 39999 && _respect < 49999):
  236.    {
  237.  _bambiPlayer forceAddUniform "U_I_G_Story_Protagonist_F";
  238.  for "_i" from 1 to 2 do {_bambiPlayer addItemToUniform "17Rnd_mas_9x21_Mag";};
  239.  _bambiPlayer addVest "TRYK_V_Sheriff_BA_T5";
  240.  //_bambiPlayer addBackpack "B_Bergen_mcamo";
  241.  _bambiPlayer addHeadgear "H_Cap_brn_SPECOPS";
  242.  _bambiPlayer addItemToVest "hgun_mas_grach_F";
  243.  _bambiPlayer addItemToVest "acc_mas_flash_gun";
  244.  _bambiPlayer addItemToVest "muzzle_mas_snds_LM";
  245.  _bambiPlayer addItemToVest "optic_Yorris";
  246.  //_bambiPlayer addItemToVest "Exile_Melee_Axe";
  247.  _bambiPlayer addItemToVest "Exile_Magazine_Swing";
  248.  _bambiPlayer addItem "Exile_Item_Foolbox";
  249.   //_bambiPlayer addWeaponGlobal "hgun_mas_grach_F";
  250.  //_bambiPlayer addHandgunItem "acc_mas_flash_gun";
  251.  //_bambiPlayer addHandgunItem "muzzle_mas_snds_LM";
  252.  //_bambiPlayer addHandgunItem "optic_Yorris";
  253.  _bambiPlayer addItem "Exile_Item_Matches";
  254.  _bambiPlayer linkItem "ItemGPS";
  255.  _bambiPlayer addWeaponGlobal "Exile_Melee_Axe";
  256.  //_bambiPlayer addMagazine "Exile_Magazine_Swing";
  257.  _bambiPlayer addItem "Exile_Item_EMRE";
  258.  _bambiPlayer addItem "Exile_Item_PlasticBottleFreshWater";
  259.  _bambiPlayer addItem "Exile_Item_InstaDoc";
  260.      
  261.   systemChat "Your rank is Triggerman";
  262.    };
  263.  
  264.     case (_respect > 49999 && _respect < 69999):
  265.    {
  266.  _bambiPlayer forceAddUniform "U_I_G_resistanceLeader_F";
  267.  for "_i" from 1 to 2 do {_bambiPlayer addItemToUniform "25Rnd_mas_9x19_Mag";};
  268.  _bambiPlayer addVest "TRYK_V_Sheriff_BA_T5";
  269.  //_bambiPlayer addBackpack "B_Bergen_mcamo";
  270.  _bambiPlayer addHeadgear "H_Cap_oli_hs";
  271.  _bambiPlayer addItemToVest "hgun_mas_uzi_F";
  272.   //_bambiPlayer addWeapon "hgun_mas_uzi_F";
  273.  _bambiPlayer addItem "Exile_Item_Matches";
  274.  _bambiPlayer linkItem "ItemGPS";
  275.  //_bambiPlayer addItemToVest "Exile_Melee_Axe";
  276.  _bambiPlayer addItemToVest "Exile_Magazine_Swing";
  277.  _bambiPlayer addWeaponGlobal "Exile_Melee_Axe";
  278.  //_bambiPlayer addMagazine "Exile_Magazine_Swing";
  279.  _bambiPlayer addItem "Exile_Item_Foolbox";
  280.  _bambiPlayer addItem "Exile_Item_EMRE";
  281.  _bambiPlayer addItem "Exile_Item_PlasticBottleFreshWater";
  282.  _bambiPlayer addItem "Exile_Item_InstaDoc";
  283.   systemChat "Your rank is Trooper";
  284.    };
  285.  
  286.     case (_respect > 69999 && _respect < 89999):
  287.    {
  288.  _bambiPlayer forceAddUniform "U_B_survival_uniform";
  289.  for "_i" from 1 to 2 do {_bambiPlayer addItemToUniform "25Rnd_mas_9x19_Mag";};
  290.  _bambiPlayer addVest "TRYK_V_Sheriff_BA_T5";
  291.  //_bambiPlayer addBackpack "B_Bergen_mcamo";
  292.  _bambiPlayer addHeadgear "H_ShemagOpen_tan";
  293.  _bambiPlayer addItemToVest "hgun_mas_uzi_F";
  294.  _bambiPlayer addItemToVest "muzzle_mas_snds_L";
  295.  _bambiPlayer addItemToVest "optic_mas_MRD";
  296.   //_bambiPlayer addWeaponGlobal "hgun_mas_uzi_F";
  297.  //_bambiPlayer addHandgunItem "muzzle_mas_snds_L";
  298.  //_bambiPlayer addHandgunItem "optic_mas_MRD";
  299.  _bambiPlayer addItem "Exile_Item_Matches";
  300.  _bambiPlayer linkItem "ItemGPS";
  301.  _bambiPlayer addWeaponGlobal "Exile_Melee_Axe";
  302.  //_bambiPlayer addMagazine "Exile_Magazine_Swing";
  303.  _bambiPlayer addItem "Exile_Item_Foolbox";
  304.  //_bambiPlayer addItemToVest "Exile_Melee_Axe";
  305.  _bambiPlayer addItemToVest "Exile_Magazine_Swing";
  306.  _bambiPlayer addItem "Exile_Item_EMRE";
  307.  _bambiPlayer addItem "Exile_Item_PlasticBottleFreshWater";
  308.  _bambiPlayer addItem "Exile_Item_InstaDoc";
  309.   systemChat "Your rank is High Executioner";
  310.    };
  311.  
  312.      case (_respect > 89999 && _respect < 149999):
  313.    {
  314.  _bambiPlayer forceAddUniform "U_BG_Guerrilla_6_1";
  315.  //for "_i" from 1 to 2 do {_bambiPlayer addItemToUniform "30Rnd_mas_9x21_Stanag";};
  316.  _bambiPlayer addVest "TRYK_V_Sheriff_BA_T5";
  317.  //_bambiPlayer addBackpack "B_Bergen_mcamo";
  318.  _bambiPlayer addHeadgear "H_Beret_blk";
  319.   //_bambiPlayer addWeapon "arifle_mas_mp5sd";
  320.  //_bambiPlayer addPrimaryWeaponItem "optic_Aco_smg";
  321.  for "_i" from 1 to 2 do {_bambiPlayer addItemToUniform "25Rnd_mas_9x19_Mag";};
  322.  _bambiPlayer addItemToVest "hgun_mas_uzi_F";
  323.  _bambiPlayer addItemToVest "muzzle_mas_snds_L";
  324.  _bambiPlayer addItemToVest "optic_mas_MRD";
  325.  //_bambiPlayer addWeapon "hgun_mas_uzi_F";
  326.  //_bambiPlayer addHandgunItem "muzzle_mas_snds_L";
  327.  //_bambiPlayer addHandgunItem "optic_mas_MRD";
  328.  _bambiPlayer addItem "Exile_Item_Matches";
  329.  _bambiPlayer addItem "Exile_Item_Foolbox";
  330.  _bambiPlayer linkItem "ItemGPS";
  331.  //_bambiPlayer addItemToVest "Exile_Melee_Axe";
  332.  _bambiPlayer addItemToVest "Exile_Magazine_Swing";
  333.  _bambiPlayer addWeaponGlobal "Exile_Melee_Axe";
  334.  //_bambiPlayer addMagazine "Exile_Magazine_Swing";
  335.  _bambiPlayer addItem "Exile_Item_EMRE";
  336.  _bambiPlayer addItem "Exile_Item_PlasticBottleFreshWater";
  337.  _bambiPlayer addItem "Exile_Item_InstaDoc";
  338.   systemChat "Your rank is Reaper";
  339.    };
  340.  
  341.      case (_respect > 149999):
  342.    {
  343.  _bambiPlayer forceAddUniform "Exile_Uniform_Woodland";
  344.  //for "_i" from 1 to 2 do {_bambiPlayer addItemToUniform "30Rnd_mas_9x39_mag";};
  345.  _bambiPlayer addVest "TRYK_V_Sheriff_BA_T5";
  346.  //_bambiPlayer addBackpack "B_Bergen_mcamo";
  347.  _bambiPlayer addHeadgear "H_ShemagOpen_khk";
  348.   //_bambiPlayer addWeaponGlobal "arifle_mas_asval";
  349.  //_bambiPlayer addPrimaryWeaponItem "acc_flashlight";
  350.  //_bambiPlayer addPrimaryWeaponItem "optic_mas_kobra";
  351.  for "_i" from 1 to 2 do {_bambiPlayer addItemToVest "25Rnd_mas_9x19_Mag";};
  352.  //_bambiPlayer addWeaponGlobal "hgun_mas_uzi_F";
  353.  _bambiPlayer addItemToVest "hgun_mas_uzi_F";
  354.  _bambiPlayer addItemToVest "optic_Yorris";
  355.  _bambiPlayer addItemToVest "muzzle_mas_snds_L";
  356.  //_bambiPlayer addHandgunItem "optic_Yorris";
  357.  //_bambiPlayer addHandgunItem "muzzle_mas_snds_L";
  358.  _bambiPlayer addItem "Exile_Item_Foolbox";
  359.  _bambiPlayer addItem "Exile_Item_Matches";
  360.  _bambiPlayer linkItem "ItemGPS";
  361.  //_bambiPlayer addItemToVest "Exile_Melee_Axe";
  362.  _bambiPlayer addItemToVest "Exile_Magazine_Swing";
  363.  _bambiPlayer addWeaponGlobal "Exile_Melee_Axe";
  364.  //_bambiPlayer addMagazine "Exile_Magazine_Swing";
  365.  _bambiPlayer addItem "Exile_Item_EMRE";
  366.  _bambiPlayer addItem "Exile_Item_PlasticBottleFreshWater";
  367.  _bambiPlayer addItem "Exile_Item_InstaDoc";
  368.   systemChat "Your rank is Supreme Overlord";
  369.    };
  370.     default
  371.     {
  372. systemChat "Your rank is Inmate";
  373.  };
  374. };
  375.  
  376. _bambiPlayer addMPEventHandler ["MPKilled", {_this call ExileServer_object_player_event_onMpKilled}];
  377. _bambiPlayer call ExileServer_object_player_database_insert;
  378. _bambiPlayer call ExileServer_object_player_database_update;
  379. [
  380.     _sessionID,
  381.     "createPlayerResponse",
  382.     [
  383.         _bambiPlayer,
  384.         _parachuteNetID,
  385.         str (_accountData select 0),
  386.         (_accountData select 1),
  387.         (_accountData select 2),
  388.         100,
  389.         100,
  390.         0,
  391.         (getNumber (configFile >> "CfgSettings" >> "BambiSettings" >> "protectionDuration")) * 60,
  392.         _clanData,
  393.         _spawnType
  394.     ]
  395. ]
  396. call ExileServer_system_network_send_to;
  397. [_sessionID, _bambiPlayer] call ExileServer_system_session_update;
  398. 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