Desrat 0 Posted August 8, 2013 Trying to add a radio trigger that can only be used by a logged in admin. I've tried the code below and get a missing ; message on line 2 (the beginning of the if statmentI don't see any broken syntax), anyone shed any light on it? _isAdmin = serverCommandAvailable "#lock"; if (_isAdmin) { // run command } else { // dont run command }; Share this post Link to post Share on other sites
mantls 2 Posted August 8, 2013 are you trying this in the Editor? Share this post Link to post Share on other sites
Desrat 0 Posted August 8, 2013 sorry no, radio trigger runs this in a script file. Share this post Link to post Share on other sites
mantls 2 Posted August 8, 2013 that might be the problem, check it on a dedicated server ^^ Share this post Link to post Share on other sites
Desrat 0 Posted August 9, 2013 nope helps if you actually use SQF for your if's correctly instead of PHP :), thats the day job biting me in the ass. [color=#3E3E3E]_isAdmin = serverCommandAvailable "#lock";[/color] if (_isAdmin) [font=arial black][u][color=#ff0000][b]then[/b][/color][/u][/font] { // run command } else { // dont run command [color=#3E3E3E]};[/color] Share this post Link to post Share on other sites
galzohar 31 Posted August 9, 2013 Yes. "Missing ;" is usually some sort of syntax error or a typo in one of your commands/variables that makes the engine not understand what you want and thus expect the command to end with a ;. In this case you are indeed missing the all annoying then. Sometimes, "missing ;" actually means you are missing a ;. :) Share this post Link to post Share on other sites
mantls 2 Posted August 10, 2013 nope helps if you actually use SQF for your if's correctly instead of PHP :), thats the day job biting me in the ass. [color=#3E3E3E]_isAdmin = serverCommandAvailable "#lock";[/color] if (_isAdmin) [font=arial black][u][color=#ff0000][b]then[/b][/color][/u][/font] { // run command } else { // dont run command [color=#3E3E3E]};[/color] omg, lol. Dunno, how i couldn't see that! The most obvious things... :D Share this post Link to post Share on other sites