-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbroadcast.sqf
45 lines (40 loc) · 1.32 KB
/
broadcast.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
ISSE_pub_varCount = playercount;
ISSE_pub_varNum = rolenumber;
ISSE_pub_varName = format["ISSE_pub_Pstr_%1", ISSE_pub_varNum];
for [{_i=0}, {_i <= (ISSE_pub_varCount)}, {_i=_i+1}] do {
_varName = format["ISSE_pub_Pstr_%1", _i];
call compile format['%1 = " ";', _varName];
_varName addPublicVariableEventHandler {call compile (_this select 1);};
};
broadcast = {
if ((TypeName _this) == "STRING") then {
call compile format['%1 = ''%2'';', ISSE_pub_varName, _this];
publicVariable ISSE_pub_varName;
call compile _this;
} else {
hint "Public Error: expecting String.";
};
};
broadcast_cli = {
if (!isServer) then {exit;};
_string = _this select 0;
_owner = _this select 1;
if ((TypeName _string) == "STRING") then {
call compile format['%1 = ''%2'';', ISSE_pub_varName, _string];
_owner publicVariableClient ISSE_pub_varName;
} else {
diag_log text "Public Error: expecting String.";
};
};
broadcast_srv = {
if (isServer) then {exit;};
if ((TypeName _this) == "STRING") then {
call compile format['%1 = ''%2'';', ISSE_pub_varName, _this];
publicVariableServer ISSE_pub_varName;
} else {
hint "Public Error: expecting String.";
};
};
ISSE_pub_execStr = {
if ((TypeName _this) == "STRING") then {call compile _this;} else {hint "Public Error: expecting String.";};
};