Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. /*
  2. File: fn_spawnConfirm.sqf
  3. Author: Bryan "Tonic" Boardwine
  4.  
  5. Description:
  6. Spawns the player where he selected.
  7. */
  8. private ["_spCfg","_sp","_spawnPos"];
  9. closeDialog 0;
  10. cutText ["","BLACK IN"];
  11. if (life_spawn_point isEqualTo []) then {
  12. private ["_sp","_spCfg"];
  13. _spCfg = [playerSide] call life_fnc_spawnPointCfg;
  14. _sp = _spCfg select 0;
  15.  
  16. if (playerSide isEqualTo civilian) then {
  17. if (isNil {(call compile format ["%1",_sp select 0])}) then {
  18. player setPos (getMarkerPos (_sp select 0));
  19. } else {
  20. _spawnPos = (call compile format ["%1",_sp select 0]) call BIS_fnc_selectRandom;
  21. _spawnPos = _spawnPos buildingPos 0;
  22. player setPos _spawnPos;
  23. };
  24. } else {
  25. if ((_sp select 0) isEqualTo "cop_spawn_7") then {
  26. player setPosATL [getMarkerPos "cop_spawn_7" # 0, getMarkerPos "cop_spawn_7" # 1, 138];
  27. } else {
  28. player setPos (getMarkerPos (_sp select 0));
  29. };
  30. };
  31. titleText[format ["%2 %1",_sp select 1,localize "STR_Spawn_Spawned"],"BLACK IN"];
  32. } else {
  33. if (playerSide isEqualTo civilian) then {
  34. if (isNil {(call compile format ["%1",life_spawn_point select 0])}) then {
  35. if (["house",life_spawn_point select 0] call BIS_fnc_inString) then {
  36. private ["_bPos","_house","_pos"];
  37. _house = nearestObjects [getMarkerPos (life_spawn_point select 0),["House_F"],10] select 0;
  38. _bPos = [_house] call life_fnc_getBuildingPositions;
  39.  
  40. if (_bPos isEqualTo []) exitWith {
  41. player setPos (getMarkerPos (life_spawn_point select 0));
  42. };
  43.  
  44. {_bPos = _bPos - [(_house buildingPos _x)];} forEach (_house getVariable ["slots",[]]);
  45. _pos = _bPos call BIS_fnc_selectRandom;
  46. player setPosATL _pos;
  47. } else {
  48. player setPos (getMarkerPos (life_spawn_point select 0));
  49. };
  50. } else {
  51. _spawnPos = (call compile format ["%1", life_spawn_point select 0]) call BIS_fnc_selectRandom;
  52. _spawnPos = _spawnPos buildingPos 0;
  53. player setPos _spawnPos;
  54. };
  55. } else {
  56. player setPos (getMarkerPos (life_spawn_point select 0));
  57. };
  58. titleText[format ["%2 %1",life_spawn_point select 1,localize "STR_Spawn_Spawned"],"BLACK IN"];
  59. };
  60.  
  61. if (life_firstSpawn) then {
  62. life_firstSpawn = false;
  63. [] call life_fnc_welcomeNotification;
  64. };
  65. [] call life_fnc_playerSkins;
  66. [] call life_fnc_hudSetup;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement