getPlayerScores: Difference between revisions

From Bohemia Interactive Community
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"\))?|Effects|Multiplayer Effects( \("local" or "global"\))?|Multiplayer Exe...)
(Add side changing issue note)
 
(23 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command
{{RV|type=command
|arma3
 
|1.56
|game1= arma3
|version1= 1.56


|gr1= Multiplayer
|gr1= Multiplayer


|  
|descr= Returns the unit's table of scores (infantry kills, soft vehicle kills, armor kills, air kills, deaths, total score) '''in multiplayer''' or an empty array in singleplayer.
* In MP: Returns the unit's table of scores (infantry kills, soft vehicle kills, armor kills, air kills, deaths, total score).
{{Feature|important|This command does not work (returns empty array) if the unit's side has been changed (e.g <sqf inline>[player] joinSilent createGroup east</sqf>).}}
* In SP: Empty array []
'''getPlayerScores''' unitName
|p1= unitName: [[Object]]
|p2=
| [[Array]] - the score of the given player in format [infantry kills, soft vehicle kills, armor kills, air kills, deaths, total score]
|x1= <code>[[getPlayerScores]] BIS_player1;</code>


| [[score]], [[addScore]], [[scoreSide]], [[addScoreSide]], [[addPlayerScores]]
|s1= [[getPlayerScores]] unitName
}}


|p1= unitName: [[Object]]


<h3 style='display:none'>Bottom Section</h3>
|r1= [[Array]] of [[Number]]s - the score of the given player in format [infantry kills, soft vehicle kills, armor kills, air kills, deaths, total score]
{{GameCategory|arma3|Scripting Commands}}
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]


<h3 style='display:none'>Notes</h3>
|x1= <sqf>
<dl class="command_description">
getPlayerScores BIS_player1; // e.g [4, 0, 3, 1, 2, 16]
<!-- BEGIN Note Section -->
// or in SP: []
<!-- END Note Section -->
</sqf>
</dl>


<h3 style="display:none">Bottom Section</h3>
|seealso= [[score]] [[addScore]] [[scoreSide]] [[addScoreSide]] [[addPlayerScores]]
{{GameCategory|arma3|New Scripting Commands}}
}}
{{GameCategory|arma3|Scripting Commands}}
 
<!-- CONTINUE Notes -->
 
<!-- DISCONTINUE Notes -->

Latest revision as of 13:09, 26 February 2025

Hover & click on the images for description

Description

Description:
Returns the unit's table of scores (infantry kills, soft vehicle kills, armor kills, air kills, deaths, total score) in multiplayer or an empty array in singleplayer.
This command does not work (returns empty array) if the unit's side has been changed (e.g c[player] joinSilent createGroup east).
Groups:
Multiplayer

Syntax

Syntax:
getPlayerScores unitName
Parameters:
unitName: Object
Return Value:
Array of Numbers - the score of the given player in format [infantry kills, soft vehicle kills, armor kills, air kills, deaths, total score]

Examples

Example 1:
Copy
getPlayerScores BIS_player1; // e.g [4, 0, 3, 1, 2, 16] // or in SP: []

Additional Information

See also:
score addScore scoreSide addScoreSide addPlayerScores

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