secondcoming

ExileServer_object_player_network_createPlayerRequest.sqf

Jul 1st, 2016
570
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 3.91 KB | None | 0 0
  1. /**
  2.  * ExileServer_object_player_network_createPlayerRequest
  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","_parameters","_requestingPlayer","_spawnLocationMarkerName","_playerUID","_accountData","_bambiPlayer","_cargoType"];
  13. _sessionID = _this select 0;
  14. _parameters = _this select 1;
  15. _requestingPlayer = _sessionID call ExileServer_system_session_getPlayerObject;
  16.  
  17. _bambiuniforms = [
  18.             "U_C_Journalist",
  19.             "U_C_Poloshirt_blue",
  20.             "U_C_Poloshirt_burgundy",
  21.             "U_C_Poloshirt_salmon",
  22.             "U_C_Poloshirt_stripped",
  23.             "U_C_Poloshirt_tricolour",
  24.             "U_C_Poor_1",
  25.             "U_C_Poor_2",
  26.             "U_C_Poor_shorts_1",
  27.             "U_C_Scientist",
  28.             "U_OrestesBody",
  29.             "U_Rangemaster",
  30.             "U_NikosAgedBody",
  31.             "U_NikosBody",
  32.             "U_Competitor",
  33.             "U_B_CombatUniform_mcam",
  34.             "U_B_CombatUniform_mcam_tshirt",
  35.             "U_B_CombatUniform_mcam_vest",
  36.             "U_B_CombatUniform_mcam_worn",
  37.             "U_B_CTRG_1",
  38.             "U_B_CTRG_2",
  39.             "U_B_CTRG_3",
  40.             "U_I_CombatUniform",
  41.             "U_I_CombatUniform_shortsleeve",
  42.             "U_I_CombatUniform_tshirt",
  43.             "U_I_OfficerUniform",
  44.             "U_O_CombatUniform_ocamo",
  45.             "U_O_CombatUniform_oucamo",
  46.             "U_O_OfficerUniform_ocamo",
  47.             "U_B_SpecopsUniform_sgg",
  48.             "U_O_SpecopsUniform_blk",
  49.             "U_O_SpecopsUniform_ocamo",
  50.             "U_I_G_Story_Protagonist_F",
  51.             "Exile_Uniform_Woodland",
  52.             "U_C_HunterBody_grn",
  53.             "U_IG_Guerilla1_1",
  54.             "U_IG_Guerilla2_1",
  55.             "U_IG_Guerilla2_2",
  56.             "U_IG_Guerilla2_3",
  57.             "U_IG_Guerilla3_1",
  58.             "U_BG_Guerilla2_1",
  59.             "U_IG_Guerilla3_2",
  60.             "U_BG_Guerrilla_6_1",
  61.             "U_BG_Guerilla1_1",
  62.             "U_BG_Guerilla2_2",
  63.             "U_BG_Guerilla2_3",
  64.             "U_BG_Guerilla3_1",
  65.             "U_BG_leader",
  66.             "U_IG_leader",
  67.             "U_I_G_resistanceLeader_F"
  68. ] call BIS_fnc_selectRandom;
  69. _bambifood = ["Exile_Item_EMRE","Exile_Item_GloriousKnakworst","Exile_Item_Surstromming","Exile_Item_SausageGravy","Exile_Item_Catfood","Exile_Item_ChristmasTinner","Exile_Item_BBQSandwich","Exile_Item_Dogfood","Exile_Item_BeefParts","Exile_Item_Cheathas","Exile_Item_Noodles","Exile_Item_SeedAstics","Exile_Item_Raisins","Exile_Item_Moobar"] call BIS_fnc_selectRandom;
  70. _bambidrink = ["Exile_Item_PlasticBottleCoffee","Exile_Item_PowerDrink","Exile_Item_PlasticBottleFreshWater","Exile_Item_Beer","Exile_Item_EnergyDrink","Exile_Item_MountainDupe"] call BIS_fnc_selectRandom;
  71.  
  72. try
  73. {
  74.     if (isNull _requestingPlayer) then
  75.     {
  76.         throw format ["Session %1 requested a bambi character, but doesn't have a player object. Hacker or Monday?", _sessionID];
  77.     };
  78.     _spawnLocationMarkerName = _parameters select 0;
  79.     _playerUID = getPlayerUID _requestingPlayer;
  80.     if(_playerUID isEqualTo "")then
  81.     {
  82.         throw format ["Player: '%1' has no player UID. Arma/Steam sucks!.",name _requestingPlayer];
  83.     };
  84.     _accountData = format["getAccountStats:%1", _playerUID] call ExileServer_system_database_query_selectSingle;
  85.     _group = call ExileServer_system_group_getOrCreateLoneWolfGroup;
  86.     _bambiPlayer = _group createUnit ["Exile_Unit_Player", [0,0,0], [], 0, "CAN_COLLIDE"];
  87.     _bambiplayer forceadduniform _bambiuniforms;
  88.     _bambiplayer addItem _bambifood;
  89.     _bambiplayer addItem _bambidrink;
  90.     removeHeadgear _bambiPlayer;
  91.     {
  92.         _cargoType = _x call ExileClient_util_cargo_getType;
  93.         switch (_cargoType) do
  94.         {
  95.             case 1:     { _bambiPlayer addItem _x; };
  96.             case 2:     { _bambiPlayer addWeaponGlobal _x; };
  97.             case 3:     { _bambiPlayer addBackpackGlobal _x; };
  98.             case 4:     { _bambiPlayer linkItem _x; };
  99.             default                     { _bambiPlayer addItem _x; };
  100.         };
  101.     }
  102.     forEach getArray(configFile >> "CfgSettings" >> "BambiSettings" >> "loadOut");
  103.     [_sessionID, _requestingPlayer, _spawnLocationMarkerName, _bambiPlayer, _accountData] call ExileServer_object_player_createBambi;
  104. }
  105. catch
  106. {
  107.     _exception call ExileServer_util_log;
  108. };
Add Comment
Please, Sign In to add comment