{"name":"setFriend","operator":null,"title":"setFriend","type":"command","url":"https://community.bistudio.com/wiki/setFriend","revid":341629,"updated":"2023-06-12T19:02:54Z","groups":["Sides"],"status":"ok","replaced_by":[],"games":[{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":"global","server_exec":true},"exec":null,"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]","since":null,"effect":null,"exec":null,"params":[{"name":"side1","type":"Side","optional":false,"default":null,"description":null,"types":["Side"],"since":null,"text":"side1: Side"},{"name":"side2","type":"Side","optional":false,"default":null,"description":null,"types":["Side"],"since":null,"text":"side2: Side"},{"name":"value","type":"Number","optional":false,"default":null,"description":"a value smaller than 0.6 results in being enemy, otherwise *side1* is friendly to *side2*","types":["Number"],"since":null,"text":"value: Number - a value smaller than 0.6 results in being enemy, otherwise *side1* is friendly to *side2*"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"side1","types":["Side"]},"right":{"text":"[side2, value]","types":["Array"]}}],"examples":[{"text":"```sqf\nwest setFriend [resistance, 0]; // west will not like resistance from now on\n```","code":["west setFriend [resistance, 0]; // west will not like resistance from now on"]},{"text":"```sqf\nresistance 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\n```","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"]},{"text":"```sqf\nwest setFriend [west, 0]; // free for all deathmatch! works with west/blufor, east/opfor, independent/resistance and civilian\n```","code":["west setFriend [west, 0]; // free for all deathmatch! works with west/blufor, east/opfor, independent/resistance and civilian"]}],"multiplayer":null,"problems":null,"aliases":[],"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."}],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Sides","Introduced with Operation Flashpoint: Elite version 1.00","Operation Flashpoint: Elite: New Scripting Commands","Operation Flashpoint: Elite: Scripting Commands","Scripting Commands","Scripting Commands: Global Effect","Scripting Commands: Server Execution","Take On Helicopters: Scripting Commands"]}