From c49ee692659f736d3516694930e3729bfb139a4e Mon Sep 17 00:00:00 2001 From: "DESKTOP-UH65DCE\\MusTanG" Date: Thu, 3 Aug 2017 09:42:49 -0500 Subject: [PATCH] add some tidybowl --- .../functions/EPOCH_client_updatePlayerStat.sqf | 16 ++++++---------- .../EPOCH_server_updatePlayerStats.sqf | 3 +++ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Sources/epoch_code/compile/functions/EPOCH_client_updatePlayerStat.sqf b/Sources/epoch_code/compile/functions/EPOCH_client_updatePlayerStat.sqf index 18d96b20..2c96b4a4 100644 --- a/Sources/epoch_code/compile/functions/EPOCH_client_updatePlayerStat.sqf +++ b/Sources/epoch_code/compile/functions/EPOCH_client_updatePlayerStat.sqf @@ -12,6 +12,9 @@ Licence: Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/functions/EPOCH_client_updatePlayerStat.sqf + usage: // This will add +15 to the "ZedKills" index and will also update the server variable ["ZedKills",15,true] call EPOCH_client_updatePlayerStat; @@ -25,23 +28,16 @@ */ params [ ["_statType",""], ["_adjust",0], ["_toServer",false] ]; -if(isNull player)exitWith{ - diag_log "EPOCHDebug: updatePlayerStats -1- player is null object"; -}; if(_statType isEqualTo "")exitWith{ diag_log "EPOCHDebug: updatePlayerStats -2- stat type not defined"; }; if(_adjust isEqualTo 0)exitWith{ diag_log "EPOCHDebug: updatePlayerStats -3- stat adjustment is 0"; }; -_playerUID = getplayerUID player; -if(_playerUID isEqualTo "")exitWith{ - diag_log "EPOCHDebug: updatePlayerStats -4- player UID is empty"; -}; -_statVarName = format["EPOCH_total%1",_statType]; -_currentStat = missionNameSpace getVariable[_statVarName,0]; -_newStat = _currentStat + _adjust; +private _statVarName = format["EPOCH_total%1",_statType]; +private _currentStat = missionNameSpace getVariable[_statVarName,0]; +private _newStat = _currentStat + _adjust; missionNameSpace setVariable[_statVarName,_newStat]; if(_toServer)then{ diff --git a/Sources/epoch_server/compile/epoch_player/EPOCH_server_updatePlayerStats.sqf b/Sources/epoch_server/compile/epoch_player/EPOCH_server_updatePlayerStats.sqf index 73e87220..000211ca 100644 --- a/Sources/epoch_server/compile/epoch_player/EPOCH_server_updatePlayerStats.sqf +++ b/Sources/epoch_server/compile/epoch_player/EPOCH_server_updatePlayerStats.sqf @@ -10,6 +10,9 @@ Licence: Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_player/EPOCH_server_updatePlayerStats.sqf + usage: example 1: