Advertisement
Guest User

Untitled

a guest
Jan 4th, 2020
1,295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.65 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", "_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. // Custom Loadout Starts Here.Modified by: nagyszebi07
  145.  
  146. // Clothing
  147. _bambiPlayer forceAddUniform "CUP_U_B_USArmy_TwoKnee"; // Uniform Woodland
  148. _bambiPlayer addVest "V_TacVest_oli"; // Change Vest Class Here
  149. _bambiPlayer addHeadgear "H_MilCap_wdl"; // Change Headgear Class Here
  150. _bambiPlayer addBackpack "B_Carryall_cbr"; // Change Backpack Class Here
  151.  
  152. // Navigation Items
  153. _bambiPlayer linkItem "ItemGPS"; // This Puts The GPS Into The Correct Slot
  154. _bambiPlayer linkItem "Exile_Item_XM8"; // This Puts The XM8 Into The Correct Slot
  155. _bambiPlayer linkItem "ItemCompass"; //This Puts The Compass Into The Correct Slot
  156. _bambiPlayer linkItem "ItemMap"; //This Puts The Map Into The Correct Slot
  157. _bambiPlayer linkItem "ItemRadio"; //This Puts The Radio Into The Correct Slot
  158. _bambiPlayer linkItem "NVGoggles_OPFOR"; //This NVGoggles_OPFOR
  159.  
  160. // Food and Drink Items
  161. _bambiPlayer addItem "Exile_Item_PlasticBottleCoffee"; // Change Drink Class Here
  162.  
  163. // Medical Items
  164. _bambiPlayer addItem "Exile_Item_InstaDoc"; // Change Meds Class Here
  165. _bambiPlayer addItem "Exile_Item_InstaDoc"; // Change Meds Class Here
  166.  
  167. // Items
  168. _bambiPlayer addItem "Exile_Item_DuctTape";
  169. _bambiPlayer addItem "Exile_Item_DuctTape";
  170.  
  171. // Ammo
  172. _bambiPlayer addItemToVest "30rnd_65x39_caseless_khaki_mag"; // Ammo For Weapon Listed Below
  173. _bambiPlayer addItemToVest "30rnd_65x39_caseless_khaki_mag"; // Ammo For Weapon Listed Below
  174. _bambiPlayer addItemToVest "30rnd_65x39_caseless_khaki_mag"; // Ammo For Weapon Listed Below
  175. _bambiPlayer addItemToVest "30rnd_65x39_caseless_khaki_mag"; // Ammo For Weapon Listed Below
  176.  
  177. // Weapons
  178. _bambiPlayer addWeapon "arifle_mX_khk_F"; // Primary Weapon
  179. _bambiPlayer addWeapon "Rangefinder"; // Primary Weapon
  180.  
  181. // Weapons Attachments
  182. _bambiPlayer addPrimaryWeaponItem "optic_Holosight"; // Adds Attachment to Primary Weapon | Change Attachment Class Here
  183.  
  184. // Custom Loadout Ends Here. Uncomment the lines you want your players to have..
  185.  
  186. if (getNumber(missionConfigFile >> "CfgSimulation" >> "enableDynamicSimulation") isEqualTo 1) then
  187. {
  188. if ((canTriggerDynamicSimulation _bambiPlayer) isEqualTo false) then
  189. {
  190. _bambiPlayer triggerDynamicSimulation true;
  191. _bambiPlayer enableDynamicSimulation true;
  192. };
  193. };
  194. _bambiPlayer addMPEventHandler ["MPKilled", {_this call ExileServer_object_player_event_onMpKilled}];
  195. if !(_escapeEnabled) then
  196. {
  197. _bambiPlayer call ExileServer_object_player_database_insert;
  198. _bambiPlayer call ExileServer_object_player_database_update;
  199. };
  200. [
  201. _sessionID,
  202. "createPlayerResponse",
  203. [
  204. _bambiPlayer,
  205. _parachuteNetID,
  206. str (_accountData select 0),
  207. (_accountData select 1),
  208. (_accountData select 2),
  209. 100,
  210. 100,
  211. 0,
  212. (getNumber (configFile >> "CfgSettings" >> "BambiSettings" >> "protectionDuration")) * 60,
  213. _clanData,
  214. _spawnType
  215. ]
  216. ]
  217. call ExileServer_system_network_send_to;
  218. if (_escapeEnabled) then
  219. {
  220. [
  221. _sessionID,
  222. "escapeVariables",
  223. [
  224. (_escapeAccountdata select 0),
  225. (_escapeAccountdata select 1)
  226. ]
  227. ]
  228. call ExileServer_system_network_send_to;
  229. };
  230. [_sessionID, _bambiPlayer] call ExileServer_system_session_update;
  231. true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement