This repository has been archived by the owner on Jul 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinitPlayerServer.sqf
49 lines (42 loc) · 1.58 KB
/
initPlayerServer.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
// by Xeno
//#define __DEBUG__
#define THIS_FILE "initPlayerServer.sqf"
#include "x_setup.sqf"
//diag_log [diag_frameno, diag_ticktime, time, "Executing MPF initPlayerServer.sqf"];
__TRACE_1("","_this")
params ["_pl"];
if (str _pl == "HC_D_UNIT") exitWith {
d_HC_CLIENT_OBJ_OWNER = owner HC_D_UNIT;
__TRACE_1("","d_HC_CLIENT_OBJ_OWNER")
};
private _name = name _pl;
private _uid = getPlayerUID _pl;
private _p = d_player_store getVariable _uid;
if (isNil "_p") then {
_p = [d_AutoKickTime, time, "", 0, str _pl, sideUnknown, _name, 0, [-2, xr_max_lives] select (xr_max_lives != -1), 0, "", []];
d_player_store setVariable [_uid, _p];
__TRACE_3("Player not found","_uid","_name","_p")
} else {
__TRACE_1("player store before change","_p")
if (_name != _p select 6) then {
[format [localize "STR_DOM_MISSIONSTRING_506", _name, _p select 6], "GLOBAL"] remoteExecCall ["d_fnc_HintChatMsg", [0, -2] select isDedicated];
diag_log format [localize "STR_DOM_MISSIONSTRING_942", _name, _p select 6, _uid];
};
if (time - (_p select 9) > 600) then {
_p set [8, xr_max_lives];
};
_p set [1, time];
_p set [4, str _pl];
_p set [6, _name];
__TRACE_1("player store after change","_p")
};
#ifdef __DOMDB__
//[played how often on this server, kills radio tower]
private _rvstr = _uid + "_rvals";
private _t_ps = d_player_store getVariable [_rvstr, [0,0]];
_t_ps set [0, (_t_ps select 0) + 1];
d_player_store setVariable [_rvstr, _t_ps];
#endif
_p remoteExecCall ["d_fnc_player_stuff", owner _pl];
[player] call d_fnc_addceo;
//diag_log [diag_frameno, diag_ticktime, time, "MPF initPlayerServer.sqf processed"];