# 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.
