---
name: "serverCommandExecutable"
type: command
status: ok
groups: ["Multiplayer"]
arma3_since: "1.34"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/serverCommandExecutable
revid: 369186
updated: 2024-09-03T10:34:46Z
---

# serverCommandExecutable

*Command · Multiplayer · Arma 3 v1.34*

## Description

Returns [true](../commands/true.md) if the [serverCommand](../commands/serverCommand.md) can be performed on the machine and in this exact environment, otherwise [false](../commands/false.md). serverCommand can be executed only from [User Interface Event Handlers](../topics/User_Interface_Event_Handlers.md), and this command also checks if that's the case.

## Syntax

```sqf
serverCommandExecutable command
```

**Parameters:**

- `command`: [String](../topics/String.md) - see Multiplayer Server Commands for all available commands

**Returns:** [Boolean](../topics/Boolean.md)

## Examples

### Example 1

```sqf
_canKick = serverCommandAvailable "#kick";
```

### Example 2

Add button to the main map to lock server, which could only be activated by admin:

```sqf
with uiNamespace do {
    ctrl = findDisplay 12 ctrlCreate ["RscButton", -1];
    ctrl ctrlSetPosition [0, 0, 0.5, 0.1];
    ctrl ctrlCommit 0;
    ctrl ctrlSetText "LOCK SERVER";
    ctrl ctrlAddEventHandler ["ButtonDown",
    {    
        if (serverCommandExecutable "#lock") then {
            serverCommand "#lock";
        } else {
            hint "You need to be logged in as admin to do this";
        };
    }];
};
```

## See also

[serverCommand](../commands/serverCommand.md) · [serverCommandAvailable](../commands/serverCommandAvailable.md) · Multiplayer Server Commands

<sub>Source: [BI Community Wiki — serverCommandExecutable](https://community.bistudio.com/wiki/serverCommandExecutable) (revision 369186).</sub>
