diff --git a/Sources/epoch_code/compile/EPOCH_unitSpawn.sqf b/Sources/epoch_code/compile/EPOCH_unitSpawn.sqf index 5dd81413..20b8fe52 100644 --- a/Sources/epoch_code/compile/EPOCH_unitSpawn.sqf +++ b/Sources/epoch_code/compile/EPOCH_unitSpawn.sqf @@ -57,7 +57,9 @@ switch _unitClass do { _units pushBack _unit; _unit call _disableAI; [_unit,_trgt] execFSM "\x\addons\a3_epoch_code\System\cloak.fsm"; - _unit addEventHandler ["Killed", {["AntagonistKills",1,true] call EPOCH_client_updatePlayerStat;}]; + _unit addEventHandler ["Killed", { + [player, _this select 1, "AntagonistKills", 1, true, Epoch_personalToken] remoteExec ["EPOCH_fnc_updatePlayerStats",2]; + }]; }; }; case "GreatWhite_F": { @@ -68,7 +70,9 @@ switch _unitClass do { _units pushBack _unit; _unit call _disableAI; [_unit] execFSM "\x\addons\a3_epoch_code\System\Shark_Brain.fsm"; - _unit addEventHandler ["Killed", {["AntagonistKills",1,true] call EPOCH_client_updatePlayerStat;}]; + _unit addEventHandler ["Killed", { + [player, _this select 1, "AntagonistKills", 1, true, Epoch_personalToken] remoteExec ["EPOCH_fnc_updatePlayerStats",2]; + }]; }; }; }; @@ -92,7 +96,9 @@ switch _unitClass do { _unit setVariable ["sapperHndl",_sapperHndl]; _unit addEventHandler ["FiredNear", format ["%1 setFSMVariable [""_sFiredNear"",[_this select 1, _this select 2]];",_sapperHndl]]; _unit addEventHandler ["Hit", format ["%1 setFSMVariable [""_sHit"",[_this select 1, _this select 2]];",_sapperHndl]]; - _unit addEventHandler ["Killed", {["AntagonistKills",1,true] call EPOCH_client_updatePlayerStat;}]; + _unit addEventHandler ["Killed", { + [player, _this select 1, "AntagonistKills", 1, true, Epoch_personalToken] remoteExec ["EPOCH_fnc_updatePlayerStats",2]; + }]; }; }; }; @@ -107,7 +113,9 @@ switch _unitClass do { _unit setVariable ["sapperHndl",_sapperHndl]; _unit addEventHandler ["FiredNear", format ["%1 setFSMVariable [""_sFiredNear"",[_this select 1, _this select 2]];",_sapperHndl]]; _unit addEventHandler ["Hit", format ["%1 setFSMVariable [""_sHit"",[_this select 1, _this select 2]];",_sapperHndl]]; - _unit addEventHandler ["Killed", {["AntagonistKills",1,true] call EPOCH_client_updatePlayerStat;}]; + _unit addEventHandler ["Killed", { + [player, _this select 1, "AntagonistKills", 1, true, Epoch_personalToken] remoteExec ["EPOCH_fnc_updatePlayerStats",2]; + }]; }; }; case "Epoch_SapperB_F": { @@ -121,7 +129,9 @@ switch _unitClass do { _unit setVariable ["sapperHndl",_sapperHndl]; _unit addEventHandler ["FiredNear", format ["%1 setFSMVariable [""_sFiredNear"",[_this select 1, _this select 2]];",_sapperHndl]]; _unit addEventHandler ["Hit", format ["%1 setFSMVariable [""_sHit"",[_this select 1, _this select 2]];",_sapperHndl]]; - _unit addEventHandler ["Killed", {["AntagonistKills",1,true] call EPOCH_client_updatePlayerStat;}]; + _unit addEventHandler ["Killed", { + [player, _this select 1, "AntagonistKills", 1, true, Epoch_personalToken] remoteExec ["EPOCH_fnc_updatePlayerStats",2]; + }]; }; }; case "I_UAV_01_F": { @@ -137,7 +147,9 @@ switch _unitClass do { _driver = _grp createUnit["I_UAV_AI", position _unit, [], 0, "CAN_COLLIDE"]; _driver moveInAny _unit; [_unit, _trgt] execFSM "\x\addons\a3_epoch_code\System\Copter_brain.fsm"; - _unit addEventHandler ["Killed", {["AIKills",1,true] call EPOCH_client_updatePlayerStat;}]; + _unit addEventHandler ["Killed", { + [player, _this select 1, "AIKills", 1, true, Epoch_personalToken] remoteExec ["EPOCH_fnc_updatePlayerStats",2]; + }]; }; }; case "PHANTOM": { @@ -186,7 +198,9 @@ switch _unitClass do { _unit enableAI "MOVE"; _unit enableAI "ANIM"; _unit disableAI "FSM"; - _unit addEventHandler ["Killed", {["AIKills",1,true] call EPOCH_client_updatePlayerStat;}]; + _unit addEventHandler ["Killed", { + [player, _this select 1, "AIKills", 1, true, Epoch_personalToken] remoteExec ["EPOCH_fnc_updatePlayerStats",2]; + }]; // randomize skill for "_i" from 0 to ((count _arrSkills)-1) do { _aiskill = floor random (_arrVals select _i); diff --git a/Sources/epoch_code/compile/EPOCH_zombieSpawn.sqf b/Sources/epoch_code/compile/EPOCH_zombieSpawn.sqf index 83899de0..2dbac50d 100644 --- a/Sources/epoch_code/compile/EPOCH_zombieSpawn.sqf +++ b/Sources/epoch_code/compile/EPOCH_zombieSpawn.sqf @@ -47,6 +47,8 @@ removegoggles _unit; _zedHandle = [_unit,true] execFSM "epoch_code\system\EPOCH_zombie_brain.fsm"; _unit addEventHandler ["FiredNear", "(_this select 0) setVariable [""zFiredNear"",[_this select 1, _this select 2]];"]; _unit addEventHandler ["Hit", "(_this select 0) setVariable [""zHit"",[_this select 1, _this select 2]];"]; -_unit addEventHandler ["Killed", {["ZombieKills",1,true] call EPOCH_client_updatePlayerStat;}]; +_unit addEventHandler ["Killed", { + [player, _this select 1, "ZombieKills", 1, true, Epoch_personalToken] remoteExec ["EPOCH_fnc_updatePlayerStats",2]; +}]; _unit diff --git a/Sources/epoch_server/compile/epoch_player/EPOCH_fnc_updatePlayerStats.sqf b/Sources/epoch_server/compile/epoch_player/EPOCH_fnc_updatePlayerStats.sqf index c23bcd6e..44e56b92 100644 --- a/Sources/epoch_server/compile/epoch_player/EPOCH_fnc_updatePlayerStats.sqf +++ b/Sources/epoch_server/compile/epoch_player/EPOCH_fnc_updatePlayerStats.sqf @@ -12,7 +12,15 @@ Github: https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_player/EPOCH_fnc_updatePlayerStats.sqf */ -params ["_player","","","",["_token","",[""]]]; -if([_player,_token] call EPOCH_server_getPToken)then{ - _this call EPOCH_server_updatePlayerStats; +params ["_player","_killer","_statType","_adjust","_toClient",["_token","",[""]]]; + +if(isNull _player)exitWith{ + diag_log "EPOCHDebug: fnc_updatePlayerStats -1a- player is Null"; }; +if(isNull _killer)exitWith{ + diag_log "EPOCHDebug: fnc_updatePlayerStats -1b- non local killer is Null"; +}; + +if([_player,_token] call EPOCH_server_getPToken)then{ + [_killer, _statType, _adjust, _toClient] call EPOCH_server_updatePlayerStats; +}; \ No newline at end of file