-FW- Shaanguy 10 Posted February 9, 2015 (edited) I am trying to make if a player getVariable ["TestMode", 1], then the addaction appears to the player, but here is the script that i used, but it's not working, i am %100 sure, there is a problem, in this script. Here: I Used this in init.sqf TestIDS = []; TestIDS = TestIDS + [player addAction["<img image='' width='32' height='32'/> Test Mode (available)", "test_script.sqf", [], 1, false, false, "", "player getVariable 'TestMode' == '1'"]]; Any broken word in this post, then sorry for my bad english :) Edited February 9, 2015 by [FW] Shaanguy Share this post Link to post Share on other sites
TittErS 13 Posted February 9, 2015 Hi, the first error that i see : ["TestMode", 1] TestMode = SCALAR correction: "player getVariable 'TestMode' == 1" TestIDS = []; TestIDS = TestIDS + [player addAction["<img image='' width='32' height='32'/> Test Mode (available)", "test_script.sqf", [], 1, false, false, "", "player getVariable 'TestMode' == 1"]]; Share this post Link to post Share on other sites
Heeeere's johnny! 51 Posted February 9, 2015 (edited) Firstly, player getVariable ["TestMode", 1] is syntactically correct as the 1 is the default value taken if the value behind "TestMode" is nil. Secondly, if you use 1 (a number) as default value for the getVariable, you must not check for '1' (a string) in the action condition, because then this will always be false and the action will never be visible. So change the condition part of the addAction to this: "player getVariable ['TestMode', 1] == 1" Btw, your English is just fine. :) Edited February 9, 2015 by Heeeere's Johnny! Share this post Link to post Share on other sites
-FW- Shaanguy 10 Posted February 10, 2015 Thanks TittErS It worked! :D Thanks for more information Heeeere's Johnny! Firstly, player getVariable ["TestMode", 1] is syntactically correct as the 1 is the default value taken if the value behind "TestMode" is nil.Secondly, if you use 1 (a number) as default value for the getVariable, you must not check for '1' (a string) in the action condition, because then this will always be false and the action will never be visible. So change the condition part of the addAction to this: Share this post Link to post Share on other sites