# Exports - Server Side

## **Groups**

Read [#groups](https://madsl.gitbook.io/docs/resources/general-information#groups "mention") for more info.

### CreateGroup

```lua
@param name string
@param attributes table
@return groupTable table
CreateGroup(name, attributes)
```

This is used to create a group after the initial start of the script.

### DoesGroupExist

```lua
@param name string
@return exists boolean
DoesGroupExist(name)
```

Checks if the group exists.

### AddPlayerToGroup

```lua
@param playerId int
@param name string
@return success boolean
AddPlayerToGroup(playerId, name)
```

Adds a player to the specified group.

### RemovePlayerFromGroup

```lua
@param playerId int
@param name string
@return success boolean
RemovePlayerFromGroup(playerId, name)
```

Removes the player from the group.

### GetPlayerGroup

```lua
@param playerId int
@return groupName string
GetPlayerGroup(playerId)
```

Gets the group the specified player is in.

### IsPlayerInGroup

```lua
@param playerId int
@param group string
@return inGroup boolean
IsPlayerInGroup(playerId, group)
```

Check if the player is in the group.

### SetGroupAttribute

```lua
@param name string
@param attributes table
@param value any
SetGroupAttribute(name, attribute, value)
```

A setter for group attributes, you can also use this to remove any attributes by passing nil as a value.

### GetGroupAttribute

```lua
@param name string
@param attributes table
@return retval any
GetGroupAttribute(name, attribute)
```

A getter for group attributes.

## **Lobbies**

See [#lobbies](https://madsl.gitbook.io/docs/resources/general-information#lobbies "mention") for more info.

### CreateLobby

```lua
@param name string
@param attributes table
@return lobbyTable table
CreateLobby(name, attributes)
GetGroupAttribute(name, attribute)
```

This is used to create a lobby after the initial start of the script.

### DeleteLobby

```lua
@param name string
@return success boolean
DeleteLobby(name)
```

This is used to delete a lobby after the initial start of the script.

### DoesLobbyExist

```lua
@param name string
@return exists boolean
DoesLobbyExist(name)
```

Checks if the specified lobby exists.

### AddPlayerToLobby

```lua
@param playerId int
@param name string
@return success boolean
AddPlayerToLobby(playerId, name)
```

Adds a player to the specified lobby.

### RemovePlayerFromLobby

```lua
@param playerId int
@param name string
@return success boolean
RemovePlayerFromLobby(playerId, name)
```

Removes the player from the lobby.

### GetPlayerLobby

```lua
@param playerId int
@return groupName string
GetPlayerLobby(playerId, name)
```

Gets the lobby the specified player is in.

### SetLobbyAttribute

```lua
@param name string
@param attributes table
@param value any
SetLobbyAttribute(name, attribute, value)
```

A setter for lobby attributes, you can also use this to remove any attributes by passing nil as a value.

### GetLobbyAttribute

```lua
@param name string
@param attributes table
@return retval any
GetLobbyAttribute(name, attribute)
```

A getter for lobby attributes.

### AddGroupToLobby

```lua
@param lobby string
@param group string
@return success boolean
AddGroupToLobby(lobby, group)
```

Adds every member of a group to a lobby.

### RemoveGroupFromLobby

```lua
@param lobby string
@param group string
@return success boolean
RemoveGroupFromLobby(lobby, group) 
```

Removes every member of a group from a lobby.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://madsl.gitbook.io/docs/resources/cs-styled-killfeed/exports-server-side.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
