addPlayerScores: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (template:command argument fix)
(Add kill values)
 
(40 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|=
{{RV|type=command
____________________________________________________________________________________________


|A3|= Game
|game1= arma3
|version1= 1.62


|1.62|Game Version= (number surrounded by NO SPACES)
|serverExec= server


|exec= server|=
|gr1= Object Manipulation


____________________________________________________________________________________________
|gr2= Multiplayer


| MP server only: Adds player score. |DESCRIPTION=
|descr= MP server only: Adds player score.
____________________________________________________________________________________________
{{{!}} class="wikitable align-center"
! Kill Type
{{!}} infantry {{!}}{{!}} soft {{!}}{{!}} armor {{!}}{{!}} air {{!}}{{!}} killed
{{!}}-
! Score Points
{{!}} 1 {{!}}{{!}} 2 {{!}}{{!}} 3 {{!}}{{!}} 5 {{!}}{{!}} -1
{{!}}}


| unit [[addPlayerScores]] values |SYNTAX=
|s1= unit [[addPlayerScores]] values


|p1= unit: [[Object]] |PARAMETER1=
|p1= unit: [[Object]]
|p2= values: [[Array]] - killsInfantry , killsSoft, killsArmor, killsAir, killed
|p2= values: [[Array]] of [[Number]]s format [killsInfantry , killsSoft, killsArmor, killsAir, killed]


| Nothing |RETURNVALUE=
|r1= [[Nothing]]


____________________________________________________________________________________________
|x1= <sqf>player addPlayerScores [0, 1, 0, 0, 1];</sqf>
 
|x1= <code>[[player]] [[addPlayerScores]] [0, 1, 0, 0, 1];</code> |EXAMPLE1=
 
____________________________________________________________________________________________
 
| [[addScore]], [[addScoreSide]], [[getPlayerScores]], [[score]], [[scoreSide]] |SEEALSO=


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


<dl class="command_description">
{{Note
<!-- BEGIN Note Section -->
|user= Beno 83au
<!-- For example:
|timestamp= 20170502014800
<dd class="notedate">Posted on Month Day, Year - Time (UTC)</dd>
|text= 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.
<dt class="note">'''[[User:User Name|]]'''</dt>
So to counter this just add 2 points every time a player kills a unit from the same side:
<dd class="note">This is an example note. It is true and verifiable, and contains a little code snippet.
<sqf>player addPlayerScores [2, 0, 0, 0, 0];</sqf>
<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>
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
 
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on May 2, 2017 - 01:48 (UTC)</dd>
<dt class="note">[[User:Beno 83au|Beno 83au]]</dt>
<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's 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>
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>
}}
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 12:02, 26 February 2025

Hover & click on the images for description

Description

Description:
MP server only: Adds player score.
Kill Type infantry soft armor air killed
Score Points 1 2 3 5 -1
Groups:
Object ManipulationMultiplayer

Syntax

Syntax:
unit addPlayerScores values
Parameters:
unit: Object
values: Array of Numbers format [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
Beno 83au - c
Posted on May 02, 2017 - 01:48 (UTC)
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.