Advertisement
AeogSonny

Untitled

Mar 21st, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.40 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","_thugToCheck","_HaloSpawnCheck","_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. _thugToCheck = _sessionID call ExileServer_system_session_getPlayerObject;
  106. _HaloSpawnCheck = _thugToCheck getVariable ["playerWantsHaloSpawn", 0];
  107.  
  108. if (_HaloSpawnCheck isEqualTo 1) then
  109. {
  110. _position set [2, getNumber(configFile >> "CfgSettings" >> "BambiSettings" >> "parachuteDropHeight")];
  111. if ((getNumber(configFile >> "CfgSettings" >> "BambiSettings" >> "haloJump")) isEqualTo 1) then
  112. {
  113. _bambiPlayer addBackpackGlobal "B_Parachute";
  114. _bambiPlayer setPosATL _position;
  115. _spawnType = 2;
  116. }
  117. else
  118. {
  119. _parachuteObject = createVehicle ["Steerable_Parachute_F", _position, [], 0, "CAN_COLLIDE"];
  120. _parachuteObject setDir _direction;
  121. _parachuteObject setPosATL _position;
  122. _parachuteObject enableSimulationGlobal true;
  123. _parachuteNetID = netId _parachuteObject;
  124. _spawnType = 1;
  125. };
  126. }
  127. else
  128. {
  129. _spawnType = 0;
  130. };
  131. _bambiPlayer addMPEventHandler ["MPKilled", {_this call ExileServer_object_player_event_onMpKilled}];
  132. _bambiPlayer call ExileServer_object_player_database_insert;
  133. _bambiPlayer call ExileServer_object_player_database_update;
  134. [
  135. _sessionID,
  136. "createPlayerResponse",
  137. [
  138. _bambiPlayer,
  139. _parachuteNetID,
  140. str (_accountData select 0),
  141. (_accountData select 1),
  142. (_accountData select 2),
  143. 100,
  144. 100,
  145. 0,
  146. (getNumber (configFile >> "CfgSettings" >> "BambiSettings" >> "protectionDuration")) * 60,
  147. _clanData,
  148. _spawnType
  149. ]
  150. ]
  151. call ExileServer_system_network_send_to;
  152. [_sessionID, _bambiPlayer] call ExileServer_system_session_update;
  153. true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement