forked from tanaaKa/CMF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbriefing.sqf
93 lines (55 loc) · 2.99 KB
/
briefing.sqf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// F3 - Briefing
// Credits: Please see the F3 online manual (http://www.ferstaberinde.com/f3/en/)
// ====================================================================================
if (!hasInterface) exitWith {}; //Exit if not a player.
// MAKE SURE THE PLAYER INITIALIZES PROPERLY
if (!isDedicated && (isNull player)) then
{
waitUntil {sleep 0.1; !isNull player};
};
// ====================================================================================
// DETECT PLAYER FACTION
// The following code detects what faction the player's slot belongs to, and stores
// it in the private variable _unitfaction
private _unitfaction = toLower (faction player);
// If the unitfaction is different from the group leader's faction, the latters faction is used
if (_unitfaction != toLower (faction (leader group player))) then {_unitfaction = toLower (faction (leader group player))};
// ====================================================================================
// BRIEFING: ADMIN
// The following block of code executes only if the player is the current host
// it automatically includes a file which contains the appropriate briefing data.
if (serverCommandAvailable "#kick") then {
#include "f\briefing\f_briefing_admin.sqf"
};
// ====================================================================================
// BRIEFING: BLUFOR > NATO
// The following block of code executes only if the player is in a NATO or NATO (Pacific) slot; it
// automatically includes a file which contains the appropriate briefing data.
if (_unitfaction in ["blu_f","blu_t_f"]) exitwith {
#include "f\briefing\f_briefing_nato.sqf"
};
// ====================================================================================
// BRIEFING: OPFOR > CSAT
// The following block of code executes only if the player is in a CSAT & CSAT (Pacific) slot; it
// automatically includes a file which contains the appropriate briefing data.
if (_unitfaction in ["opf_f","opf_t_f"]) exitwith {
#include "f\briefing\f_briefing_csat.sqf"
};
// ====================================================================================
// BRIEFING: INDEPENDENT > AAF
// The following block of code executes only if the player is in a AAF
// slot; it automatically includes a file which contains the appropriate briefing data.
if (_unitfaction in ["ind_f"]) exitwith {
#include "f\briefing\f_briefing_aaf.sqf"
};
// ====================================================================================
// BRIEFING: CIVILIAN
// The following block of code executes only if the player is in a CIVILIAN
// slot; it automatically includes a file which contains the appropriate briefing data.
if (_unitfaction in ["civ_f"]) exitwith {
#include "f\briefing\f_briefing_civ.sqf"
};
// ====================================================================================
// ERROR CHECKING
// If the faction of the unit cannot be defined, the script exits with an error.
player globalchat format ["DEBUG (briefing.sqf): Faction %1 is not defined.",_unitfaction];