score: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
No edit summary
 
(61 intermediate revisions by 12 users not shown)
Line 1: Line 1:
[[Category:Scripting Commands]]
{{RV|type=command
[[Category:Scripting Commands OFP 1.97]]
[[Category:Scripting Commands OFP 1.46]]
[[Category:Scripting Commands ArmA]]


back to [[Scripting_Reference#S|COMREF]]
|game1= ofp
|version1= 1.00


<h2 style="color:#000066">'''score ''unit'''''</h2>
|game2= ofpe
|version2= 1.00


|game3= arma1
|version3= 1.00


'''Operand types:'''
|game4= arma2
|version4= 1.00


'''unit:''' [[Object]]
|game5= arma2oa
|version5= 1.50


'''Type of returned value:'''
|game6= tkoh
|version6= 1.00


[[Number]]
|game7= arma3
|version7= 0.50


'''Description:'''
|gr1= Multiplayer


'''MP:''' Check unit score.
|descr= Returns the person's score in MP.


|s1= [[score]] unit


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


pScore = '''score''' [[player]]
|r1= [[Number]]
 
|x1= <sqf>_pScore = score player;</sqf>
 
|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.