score: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " \| *(game[0-9]|version[0-9]|gr[0-9]|serverExec|mp|pr|descr|s[0-9]|p[0-9]{1,3}|r[0-9]|x1?[0-9]|seealso) *= +" to " |$1= ")
No edit summary
 
(8 intermediate revisions by one other user not shown)
Line 26: Line 26:
|descr= Returns the person's score in MP.
|descr= Returns the person's score in MP.


|s1= '''score''' unit
|s1= [[score]] unit


|p1= unit: [[Object]]
|p1= unit: [[Object]]


|r1=[[Number]]
|r1= [[Number]]


|x1= <code>_pScore = [[score]] [[player]];</code>
|x1= <sqf>_pScore = score player;</sqf>


|seealso= [[addScore]], [[scoreSide]], [[addScoreSide]], [[getPlayerScores]]
|seealso= [[addScore]] [[scoreSide]] [[addScoreSide]] [[getPlayerScores]]
}}
 
{{Note
|user= Aimgame
|timestamp= 20240309101734
|text= In MP '''score player''' returns only the score of player in faction he joined first (within one server session). <br/>
I.e. if he first logged for WEST faction and then relogged for another faction, '''score player''' will show his score when he was WEST, no matter what real score is in current faction.<br/>
In this regard it is better to use [[getPlayerScores]]:
<sqf>(getPlayerScores player) select (count (getPlayerScores player) - 1)</sqf>
or
<sqf>(getPlayerScores player) select 5</sqf>
- it will always return the player's actual score in the current faction.
}}
}}

Latest revision as of 11:17, 9 March 2024

Hover & click on the images for description

Description

Description:
Returns the person's score in MP.
Groups:
Multiplayer

Syntax

Syntax:
score unit
Parameters:
unit: Object
Return Value:
Number

Examples

Example 1:
_pScore = score player;

Additional Information

See also:
addScore scoreSide addScoreSide getPlayerScores

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
Aimgame - c
Posted on Mar 09, 2024 - 10:17 (UTC)
In MP score player returns only the score of player in faction he joined first (within one server session).
I.e. if he first logged for WEST faction and then relogged for another faction, score player will show his score when he was WEST, no matter what real score is in current faction.
In this regard it is better to use getPlayerScores: or - it will always return the player's actual score in the current faction.