addPlayerScores: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("serv...)
m (Text replacement - ">Posted on May ([0-9]{1}), ([0-9]{4})" to ">Posted on $2-05-0$1")
 
(28 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command
{{RV|type=command


| arma3
|game1= arma3
 
|version1= 1.62
|1.62


|serverExec= server
|serverExec= server
Line 11: Line 10:
|gr2= Multiplayer
|gr2= Multiplayer


|descr= MP server only: Adds player score.


| MP server only: Adds player score.
|s1= unit [[addPlayerScores]] values
 
| unit [[addPlayerScores]] values


|p1= unit: [[Object]]
|p1= unit: [[Object]]
|p2= values: [[Array]] - killsInfantry , killsSoft, killsArmor, killsAir, killed
|p2= values: [[Array]] - killsInfantry , killsSoft, killsArmor, killsAir, killed


| Nothing
|r1= [[Nothing]]


 
|x1= <sqf>player addPlayerScores [0, 1, 0, 0, 1];</sqf>
|x1= <code>[[player]] [[addPlayerScores]] [0, 1, 0, 0, 1];</code>


|seealso= [[addScore]] [[addScoreSide]] [[getPlayerScores]] [[score]] [[scoreSide]]
}}


| [[addScore]], [[addScoreSide]], [[getPlayerScores]], [[score]], [[scoreSide]]
}}


<dl class="command_description">
<dl class="command_description">
<!-- BEGIN Note Section -->
<!-- For example:
<dd class="notedate">Posted on Month Day, Year - Time (UTC)</dd>
<dt class="note">[[User:User Name|]]</dt>
<dd class="note">This is an example note. It is true and verifiable, and contains a little code snippet.
<code>[[if]] ([[_this]] == anExample) [[then]] { [[hint]] "Leave it here for others to read"; };</code></dd>
-->
<!-- END Note Section -->
</dl>
<h3 style="display:none">Bottom Section</h3>
{{GameCategory|arma3|Scripting Commands}}


<!-- CONTINUE Notes -->
<dt></dt>
<dl class="command_description">
<dd class="notedate">Posted on 2017-05-02 - 01:48 (UTC)</dd>
<dd class="notedate">Posted on May 2, 2017 - 01:48 (UTC)</dd>
<dt class="note">[[User:Beno 83au|Beno 83au]]</dt>
<dt class="note">[[User:Beno 83au|Beno 83au]]</dt>
<dd class="note">
<dd class="note">
As this command will add the given number to a player's score, a little bit of thought needs to be given to friendly-fire if it is for something like a deathmatch or a FFA, due to friendly-fire incurring negative points. So to counter this just add 2 points every time a player kills a unit from the same side:
As this command will add the given number to a player's score, a little bit of thought needs to be given to friendly-fire if it is for something like a deathmatch or a FFA, due to friendly-fire incurring negative points. So to counter this just add 2 points every time a player kills a unit from the same side:
<code>player addPlayerScores [2, 0, 0, 0, 0];</code>
<sqf>player addPlayerScores [2, 0, 0, 0, 0];</sqf>
The 2 points will add 1 point to counter the negative friendly-fire point and 1 point to add correctly to the score.
The 2 points will add 1 point to counter the negative friendly-fire point and 1 point to add correctly to the score.
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 23:01, 13 May 2023

Hover & click on the images for description

Description

Description:
MP server only: Adds player score.
Groups:
Object ManipulationMultiplayer

Syntax

Syntax:
unit addPlayerScores values
Parameters:
unit: Object
values: Array - killsInfantry , killsSoft, killsArmor, killsAir, killed
Return Value:
Nothing

Examples

Example 1:
player addPlayerScores [0, 1, 0, 0, 1];

Additional Information

See also:
addScore addScoreSide getPlayerScores score scoreSide

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note


Posted on 2017-05-02 - 01:48 (UTC)
Beno 83au
As this command will add the given number to a player's score, a little bit of thought needs to be given to friendly-fire if it is for something like a deathmatch or a FFA, due to friendly-fire incurring negative points. So to counter this just add 2 points every time a player kills a unit from the same side:
player addPlayerScores [2, 0, 0, 0, 0];
The 2 points will add 1 point to counter the negative friendly-fire point and 1 point to add correctly to the score.