Hi,
the easy way is:
Code:
_chair = (fp);
_unit = _this select 1;
_id = _this select 2;
dfp removeAction _id;
dfp removeAction lflag;
fp removeAction lflag;
dfp removeAction aflag;
_chair setVehicleInit "this setFlagTexture '\ca\ca_e\data\flag_us_co.paa'";
processInitCommands;
rflag = dfp addaction ["Raise Flag","raiseflag.sqf",[fp,true]];
dflag = dfp addaction ["Detach Flag","detachflag.sqf",[dfp,true]];
Performance friendly variant would be (For BIG missions with lots of traffic):
Init.sqf
Code:
"changeFlagTexture" addPublicVariableEventHandler {
_data = (_this select 1);
_flag = (_this select 1) select 0;
_texture = (_this select 1) select 1;
_flag setFlagTexture _texture;
};
// For JIPs
if (!isNil "changeFlagTexture") then { (changeFlagTexture select 0) setFlagTexture (changeFlagTexture select 1); };
Code:
_chair = (fp);
_unit = _this select 1;
_id = _this select 2;
dfp removeAction _id;
dfp removeAction lflag;
fp removeAction lflag;
dfp removeAction aflag;
_chair setFlagTexture "\ca\ca_e\data\flag_us_co.paa";
changeFlagTexture = [_chair, "\ca\ca_e\data\flag_us_co.paa"]; publicVariable "changeFlagTexture";
rflag = dfp addaction ["Raise Flag","raiseflag.sqf",[fp,true]];
dflag = dfp addaction ["Detach Flag","detachflag.sqf",[dfp,true]];