{"name":"setFriend","title":"setFriend","type":"command","url":"https://community.bistudio.com/wiki/setFriend","revid":341629,"updated":"2023-06-12T19:02:54Z","groups":["Sides"],"status":"ok","games":{"ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofpe 1.00","arma3_since":"0.50","locality":{"effect":"global","server_exec":true},"description":"Sets how friendly a side is with another. The friendliness is set for one side, not for the other. See also Side Relations.\n\n> [!NOTE]\n> **Arma 3:** Since Arma 3 this command can be used mid-mission. Before that it was intended to be used on mission start only, as changing value during mission could cause unexpected errors in AI behaviour (especially for groups already knowing about \"switched to enemy\" groups).","syntaxes":[{"syntax":"side1 setFriend [side2, value]","params":[{"name":"side1","type":"Side","type_expr":"Side"},{"name":"side2","type":"Side","type_expr":"Side"},{"name":"value","type":"Number","description":"a value smaller than 0.6 results in being enemy, otherwise *side1* is friendly to *side2*","type_expr":"Number"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"side1"},"right":{"text":"[side2, value]"}}],"examples":[{"code":["west setFriend [resistance, 0]; // west will not like resistance from now on"]},{"code":["resistance setFriend [east, 0];\neast setFriend [resistance, 0]; // both are enemies\n\nresistance setFriend [east, 1];\neast setFriend [resistance, 0]; // resistance likes east, but east does not like resistance"]},{"code":["west setFriend [west, 0]; // free for all deathmatch! works with west/blufor, east/opfor, independent/resistance and civilian"]}],"see_also":["getFriend","BIS_fnc_sideIsFriendly","BIS_fnc_sideIsEnemy","Side Relations"],"notes":[{"user":"Ceeeb","date":"2007-11-30T11:25:00Z","text":"Setting the civilian side to be the enemy of any other side will result in the other side attacking inanimate mission editor placed objects such as empty vehicles and static objects, since these objects belong to the civilian side."}]}