{"name":"addRating","title":"addRating","type":"command","url":"https://community.bistudio.com/wiki/addRating","revid":353042,"updated":"2024-03-12T12:07:04Z","groups":["Object Manipulation"],"status":"ok","games":{"ofp":"1.00","ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofp 1.00","arma3_since":"0.50","locality":{"argument":"local","effect":"global"},"description":"Add a number to the rating of a unit - negative values can be used to reduce the rating.\nThis 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.\nWhen the rating gets below -2000, the unit's side switches to sideEnemy and the unit is attacked by everyone.\n\n> [!NOTE]\n> See also ArmA: Armed Assault: Rating Values and Arma 3: Event Handlers - HandleRating.","syntaxes":[{"syntax":"unitName addRating rating","params":[{"name":"unitName","type":"Object","type_expr":"Object"},{"name":"rating","type":"Number","type_expr":"Number"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"unitName"},"right":{"text":"rating"}}],"examples":[{"code":["player addRating 2000;"]},{"text":"Set the rating to a specific value:\n\n```sqf\nprivate _wantedRating = 9001;\nplayer addRating (_wantedRating - rating player);\n```","code":["private _wantedRating = 9001;\nplayer addRating (_wantedRating - rating player);"]}],"see_also":["Side Relations","ArmA: Rating Values","rating","rank","setUnitRank","sideEnemy"]}