View difference between Paste ID: 0WnFAuV2 and ndryMVP3
SHOW: | | - or go back to the newest paste.
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
12
if (life_spawn_point isEqualTo []) then {
13
    private ["_sp","_spCfg"];
14
    _spCfg = [playerSide] call life_fnc_spawnPointCfg;
15
    _sp = _spCfg select 0;
16
17
    if (playerSide isEqualTo civilian) then {
18
        if (isNil {(call compile format ["%1",_sp select 0])}) then {
19
            player setPos (getMarkerPos (_sp select 0));
20
        } else {
21
            _spawnPos = (call compile format ["%1",_sp select 0]) call BIS_fnc_selectRandom;
22
            _spawnPos = _spawnPos buildingPos 0;
23
            player setPos _spawnPos;
24
        };
25-
        if ((_sp select 0) isEqualTo "cop_spawn_7") then {
25+
26
        player setPos (getMarkerPos (_sp select 0));
27
    };
28
    titleText[format ["%2 %1",_sp select 1,localize "STR_Spawn_Spawned"],"BLACK IN"];
29
} else {
30
    if (playerSide isEqualTo civilian) then {
31
        if (isNil {(call compile format ["%1",life_spawn_point select 0])}) then {
32
            if (["house",life_spawn_point select 0] call BIS_fnc_inString) then {
33
                private ["_bPos","_house","_pos"];
34
                _house = nearestObjects [getMarkerPos (life_spawn_point select 0),["House_F"],10] select 0;
35
                _bPos = [_house] call life_fnc_getBuildingPositions;
36
37
                if (_bPos isEqualTo []) exitWith {
38
                    player setPos (getMarkerPos (life_spawn_point select 0));
39
                };
40
41
                {_bPos = _bPos - [(_house buildingPos _x)];} forEach (_house getVariable ["slots",[]]);
42
                _pos = _bPos call BIS_fnc_selectRandom;
43
                player setPosATL _pos;
44
            } else {
45
                player setPos (getMarkerPos (life_spawn_point select 0));
46
            };
47
        } else {
48
            _spawnPos = (call compile format ["%1", life_spawn_point select 0]) call BIS_fnc_selectRandom;
49
            _spawnPos = _spawnPos buildingPos 0;
50
            player setPos _spawnPos;
51
        };
52
    } else {
53
        if ((life_spawn_point select 0) isEqualTo "cop_spawn_7") then {
54
            player setPosATL [getMarkerPos "cop_spawn_7" # 0, getMarkerPos "cop_spawn_7" # 1, 138];
55
        } else {
56-
        player setPos (getMarkerPos (life_spawn_point select 0));
56+
            player setPos (getMarkerPos (life_spawn_point select 0));
57
        };
58
    };
59
    titleText[format ["%2 %1",life_spawn_point select 1,localize "STR_Spawn_Spawned"],"BLACK IN"];
60
};
61
62
if (life_firstSpawn) then {
63
    life_firstSpawn = false;
64
    [] call life_fnc_welcomeNotification;
65
};
66
[] call life_fnc_playerSkins;
67
[] call life_fnc_hudSetup;