Hi
I have a simple trading script I'm working on. Players trade items for "credits" which are not in-game items, but a value held in a global variable.
The "sell" section works fine. Players sell items and the playerCredits global variable increments fine. The credit total is displayed ...
titleText [format["Hello. You have this many credits to spend: %1",(playerCredits)], "PLAIN DOWN"]; titleFadeOut 15;
so I know the variable playerCredits is working.
The trouble I have is when I try to use the variable to enable the "sell" self actions ...
if (playerCredits >= 5) then {
hasB1credits = true;
} else {
hasB1credits = false;
};
if (hasB1credits) then {
if (buy1 < 0) then {
buy1 = player addAction [("<t color=""#00c362"">" + ("Buy Scrap Metal for 5 Credits") +"</t>"),"Market\Buy\buy1.sqf","",5,false,true,"",""];
};
} else {
player removeAction buy1;
buy1 = -1;
};
In this example, I know that the value of playerCredits is greater than 5, but the self action never comes up as an option.
Can anyone tell me why the "if (playerCredits >= 5) then {" condition doesn't work?
Thank You
I have a simple trading script I'm working on. Players trade items for "credits" which are not in-game items, but a value held in a global variable.
The "sell" section works fine. Players sell items and the playerCredits global variable increments fine. The credit total is displayed ...
titleText [format["Hello. You have this many credits to spend: %1",(playerCredits)], "PLAIN DOWN"]; titleFadeOut 15;
so I know the variable playerCredits is working.
The trouble I have is when I try to use the variable to enable the "sell" self actions ...
if (playerCredits >= 5) then {
hasB1credits = true;
} else {
hasB1credits = false;
};
if (hasB1credits) then {
if (buy1 < 0) then {
buy1 = player addAction [("<t color=""#00c362"">" + ("Buy Scrap Metal for 5 Credits") +"</t>"),"Market\Buy\buy1.sqf","",5,false,true,"",""];
};
} else {
player removeAction buy1;
buy1 = -1;
};
In this example, I know that the value of playerCredits is greater than 5, but the self action never comes up as an option.
Can anyone tell me why the "if (playerCredits >= 5) then {" condition doesn't work?
Thank You