> For the complete documentation index, see [llms.txt](https://rocket-networking.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rocket-networking.gitbook.io/docs/rocket-networking-code/rooms/showallclientsinroom-room_name-and-callback_showallclientsinroom.md).

# ShowAllClientsInRoom(room\_name  ) and callback\_ShowAllClientsInRoom()

## Description

This function tells you about all the clients in a room. Enter the room name you want to check for.

#### Syntax

```
ShowAllClientsInRoom(room_name);
```

| Argument    | Description                                                                 |
| ----------- | --------------------------------------------------------------------------- |
| `room_name` | <p>The name of the RNet room you want to scan.<br>This must be a String</p> |

#### Returns

```
N/A
```

## How do I see which clients are on this room

After a successful scan of the room name you entered, the callback function **callback\_ShowAllClientsInRoom()** is called. So under Scripts/Rocket Networking/Callback Functions , you can edit this to do whatever you want…

❓ This function returns an array of all client id’s in a room. For example if there are 3 clients with clientId’s 3, 6 and 11 respectively in the room “public”, this function’s callback will return the array \[ “3” , “6” , “11” ] . It is worth noting that these are not numbers in the array, they are strings of the numbers.

### Example Implementation of function call

* So firstly I made 2 clients join the room “public”
* Then I wrote some basic code to try out this function

<figure><img src="/files/5Nh1K8RHSMTzAr2pSDA5" alt=""><figcaption></figcaption></figure>

### Example Implementation of callback(continued)

* Then after I pressed okay, this callback code took place
* Here I’ve just done a show\_message so the user is shown a dialog box with that message but you get the idea

<figure><img src="/files/34xyNX59fmQeRkhZtB0W" alt=""><figcaption></figcaption></figure>

* So what it returned in the end was

```
[7,9]in public
```

## If the room does not exist?

&#x20;⚠️ If the room you entered does not exist, this callback function will not return an array. **Instead the “array\_of\_clients” variable will be the integer -1.** So a good practice would be to first check if it is an array. If not then the room doesn’t exist. If yes then treat it as an array.
