OK, here is my original code copied directly from my mission:
DialogBuild.sqf:
//------------------------------------------------------------
//Link_CTI
//------------------------------------------------------------
_dialog = createDialog "MHQBuild_Dialog";
ctrlSetText [212,format [ctrlText 212,(call compile format["ArrMone_Si%1_%2", LinkCTI_PlayerSide,LinkCTI_PlayerGroup])]]; // This text WON'T UPDATE after it is subracted in "ButtonBuild.sqf"
ButtonBuild.sqf:
//------------------------------------------------------------
//Link_CTI
//------------------------------------------------------------
_selected = _this select 0; // when a list entry is double clicked, this is the clicked entry index.
_price = (((call compile format["ArrType_Si%1_Buil", LinkCTI_PlayerSide]) select _selected) select 5);
_money = (call compile format["ArrMone_Si%1_%2", LinkCTI_PlayerSide,LinkCTI_PlayerGroup]);
if (_money >= _price) then
{
// update array
if (LinkCTI_PlayerSide == 0) then {ArrMone_Si0 set [LinkCTI_PlayerGroup,(_money - _price)]};
if (LinkCTI_PlayerSide == 1) then {ArrMone_Si1 set [LinkCTI_PlayerGroup,(_money - _price)]};
LinkCTI_ArrMone = [ArrMone_Si0,ArrMone_Si1];
closeDialog 0;
};
// Everything works is this file. The array entry is updated and subracted and everything!
In the situation of my testing:
LinkCTI_PlayerSide = 1;
LinkCTI_PlayerGroup = 1;
LinkCTI_ArrMone is a array with the amount of money for the group.
LinkCTI_ArrType is a array that only has to do with my buildings (cost of building)