addRating: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Some wiki formatting)
 
(83 intermediate revisions by 19 users not shown)
Line 1: Line 1:
[[Category:Scripting Commands|ADDRATING]]
{{RV|type=command
[[Category:Scripting Commands OFP 1.97|ADDRATING]]
[[Category:Scripting Commands OFP 1.46|ADDRATING]]
[[Category:Scripting Commands ArmA|ADDRATING]]


|game1= ofp
|version1= 1.00


<h2 style="color:#000066">'''''unit'' addRating ''number'''''</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


'''number:''' [[Number]]
|game6= tkoh
|version6= 1.00


'''Type of returned value:'''
|game7= arma3
|version7= 0.50


[[Nothing]]
|arg= local


'''Description:'''
|eff= global


Add number to unit rating.
|gr1= Object Manipulation


This is usually used to reward for completed mission objectives.
|descr= Add a number to the [[rating]] of a unit - negative values can be used to reduce the rating.<br>
This command is usually used to reward for completed mission objectives.The rating is given at the end of the mission and is automatically adjusted when killing enemies or friendlies.<br>
When the rating gets below -2000, the unit's side switches to [[sideEnemy]] and the unit is attacked by everyone.
{{Feature|informative|See also {{Link|ArmA: Armed Assault: Rating Values}} and {{Link|Arma 3: Event Handlers#HandleRating}}.}}


Rating for killed enemies and killed friendlies is adjusted automatically.
|s1= unitName [[addRating]] rating


When rating is lower than zero, unit is consider "renegade" and is enemy to everyone.
|p1= unitName: [[Object]]


|p2= rating: [[Number]]


'''Example:'''
|r1= [[Nothing]]


player '''addRating''' 1000
|x1= <sqf>player addRating 2000;</sqf>
 
|x2= Set the rating to a specific value:
<sqf>
private _wantedRating = 9001;
player addRating (_wantedRating - rating player);
</sqf>
 
|seealso= [[Side Relations]] [[ArmA: Rating Values|Rating Values]] [[rating]] [[rank]] [[setUnitRank]] [[sideEnemy]]
}}

Latest revision as of 14:07, 12 March 2024

Hover & click on the images for description

Description

Description:
Add a number to the rating of a unit - negative values can be used to reduce the rating.
This command is usually used to reward for completed mission objectives.The rating is given at the end of the mission and is automatically adjusted when killing enemies or friendlies.
When the rating gets below -2000, the unit's side switches to sideEnemy and the unit is attacked by everyone.
Groups:
Object Manipulation

Syntax

Syntax:
unitName addRating rating
Parameters:
unitName: Object
rating: Number
Return Value:
Nothing

Examples

Example 1:
player addRating 2000;
Example 2:
Set the rating to a specific value:
private _wantedRating = 9001; player addRating (_wantedRating - rating player);

Additional Information

See also:
Side Relations Rating Values rating rank setUnitRank sideEnemy

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