{"name":"setFlagOwner","title":"setFlagOwner","type":"command","url":"https://community.bistudio.com/wiki/setFlagOwner","revid":369375,"updated":"2024-09-03T18:43:13Z","groups":["Flags","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":"global","effect":"global"},"description":"Sets flag owner. When owner is set to objNull or any object other than a unit of class man or logic, flag is returned to the flagpole. A flag owned by a logic has no visual representation.","syntaxes":[{"syntax":"flag setFlagOwner owner","params":[{"name":"flag","type":"Object","type_expr":"Object"},{"name":"owner","type":"Object","type_expr":"Object"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"flag"},"right":{"text":"owner"}}],"examples":[{"code":["_flag1 setFlagOwner _soldier1;"]},{"text":"To return the flag back to the flag pole:\n\n```sqf\n//Method 1: (set owner null)\nflag _flagCarrier setFlagOwner objNull;\n//Method 2: (set the flag mast as the owner)\nflag _flagCarrier setFlagOwner flag _flagCarrier;\n```","code":["//Method 1: (set owner null)\nflag _flagCarrier setFlagOwner objNull;\n//Method 2: (set the flag mast as the owner)\nflag _flagCarrier setFlagOwner flag _flagCarrier;"]}],"see_also":["flag","flagOwner","setFlagSide","setFlagTexture","flagSide","flagTexture","forceFlagTexture","getForcedFlagTexture"],"notes":[{"user":"Bdfy","text":"Since flags can not be owned by vehicles, use *\"flag setFlagOwner driver tank1\"* or *\"flag1 setFlagOwner tank1D\"* to assign the flag to the vehicle's driver. The second method will only work if *tank1* is the name of a unit, not a variable refering to it. True for OFP&Arma"}]}