{"name":"serverCommandAvailable","operator":null,"title":"serverCommandAvailable","type":"command","url":"https://community.bistudio.com/wiki/serverCommandAvailable","revid":370060,"updated":"2024-10-29T14:40:43Z","groups":["Multiplayer"],"status":"ok","replaced_by":[],"games":[{"game":"arma2","name":"Arma 2","version":"1.05"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma2","name":"Arma 2","version":"1.05"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Returns true if given serverCommand is available on current machine, false if not.\n\n> [!NOTE]\n> Execution via RCon is basically being **logged-in** as admin in terms of permissions.\n\n| Arma 3 Multiplayer Server Commands | Available to |  |  |  |\n|---|---|---|---|---|\n| Client | Voted Admin | Logged Admin | Server Host |  |\n| `1. login`, `1. userlist`, `1. beclient`, `1. vote` | ✓ | ✓ | ✓ | ✓ |\n| `1. kick`, `1. debug` | ✗ | ✓ | ✓ | ✓ |\n| `1. lock`, `1. unlock`, `1. maxping`, `1. maxdesync`, `1. maxpacketloss` | ✗ | ✗ | ✓ | ✓ |\n| `1. logout`, `1. restart`, `1. mission`, `1. missions`, `1. reassign`, `1. monitor`, `1. init` | ✗ | ✓ | ✓ | ✗ |\n| `1. shutdown`, `1. restartserver`, `1. restartserveraftermission`, `1. shutdownaftermission`, `1. dctimeout`, `1. exec`, `1. monitords`, `1. beserver` | ✗ | ✗ | ✓ | ✗ |\n| `1. logentities`, `1. exportjipqueue` | ✗ | ✗ | ✓ | ✓ |\n| Profiling type builds only: `1. captureframe`, `1. captureslowframe` | ✗ | ✗ | ✓ | ✓ |\n\nTo check if a server command can be executed in the current environment, use serverCommandExecutable.\n\n> [!NOTE]\n> The table above does not apply to the command's password variant on a dedicated server as everything is available to it.","syntaxes":[{"syntax":"serverCommandAvailable command","since":null,"effect":null,"exec":null,"params":[{"name":"command","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"command: String"}],"returns":{"type":"Boolean","types":["Boolean"],"description":null,"text":"Boolean"},"form":"unary","operator":null,"left":null,"right":{"text":"command","types":["String"]}}],"examples":[{"text":"```sqf\n_can = serverCommandAvailable \"#kick\";\n```","code":["_can = serverCommandAvailable \"#kick\";"]},{"text":"```sqf\nif (serverCommandAvailable \"#logout\") then \n{\n    hint \"You are a some sort of admin\";\n};\n```","code":["if (serverCommandAvailable \"#logout\") then \n{\n\thint \"You are a some sort of admin\";\n};"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["serverCommand","serverCommandExecutable","admin","isServer","Multiplayer Server Commands"],"notes":[],"categories":["Arma 2: New Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Multiplayer","Introduced with Arma 2 version 1.05","Scripting Commands","Take On Helicopters: Scripting Commands"]}