-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Log score changes * Fix log macro * Log score change reason if available
- Loading branch information
Showing
4 changed files
with
43 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#include "script_component.hpp" | ||
/* | ||
* Author: 3Mydlo3 | ||
* Function changes score for given side by given amount. | ||
* | ||
* Arguments: | ||
* 0: Side which has score changed <SIDE> | ||
* 1: Score change <NUMBER> | ||
* 2: Reason <STRING> (Optional) | ||
* | ||
* Return Value: | ||
* 0: New score <NUMBER> | ||
* | ||
* Example: | ||
* [WEST, 1] call afsk_score_fnc_changeScore | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params ["_side", "_change", ["_reason", ""]]; | ||
|
||
private _previousScore = [_side] call FUNC(getSideScore); | ||
|
||
if (_side isEqualTo WEST) then { | ||
[_change, _reason] call FUNC(addPoliceScore); | ||
} else { | ||
[_change, _reason] call FUNC(addKillersScore); | ||
}; | ||
|
||
private _newScore = [_side] call FUNC(getSideScore); | ||
|
||
if (_reason isEqualTo "") then { | ||
INFO_4("Changed score for %1: %2 + %3 = %4",_side,_previousScore,_change,_newScore); | ||
} else { | ||
INFO_5("Changed score for %1: %2 + %3 = %4, caused by %5",_side,_previousScore,_change,_newScore,_reason); | ||
}; | ||
|
||
[QGVAR(scoreChanged), [_side, _change, _newScore, _reason]] call CBA_fnc_globalEvent; | ||
|
||
_newScore |