MapRotation
Summary
MapRotation global table. Manages the server's map rotation, including adding, removing, and getting map entries.
Functions
| Method | Returns |
|---|---|
| AddMap(level: string, mode: string) | void |
| Clear(level: string, mode: string) | void |
| GetNextMap() | MapRotationEntry |
| RemoveNextMap() | void |
| GetCurrentEntryIndex() | integer |
| GetList() | MapRotationEntry[] |
Functions
AddMap
MapRotation.AddMap(level: string, mode: string): voidAdds a map entry to the end of the rotation.
Raises an error if either level or mode is an empty string.
Parameters
| Name | Type | Description |
|---|---|---|
| level | string | The level path to add. |
| mode | string | The gamemode id to add. |
Clear
MapRotation.Clear(level: string, mode: string): voidClears the entire rotation and resets it with a single required starting entry.
Raises an error if either level or mode is an empty string.
Parameters
| Name | Type | Description |
|---|---|---|
| level | string | The level path for the first entry after clearing. |
| mode | string | The gamemode id for the first entry after clearing. |
GetNextMap
MapRotation.GetNextMap(): MapRotationEntryReturns the next map entry in the rotation without removing it.
Returns
| Type | Description |
|---|---|
| MapRotationEntry | entry A table containing level and mode fields. |
RemoveNextMap
MapRotation.RemoveNextMap(): voidRemoves the next map entry from the rotation.
GetCurrentEntryIndex
MapRotation.GetCurrentEntryIndex(): integerReturns the current index within the map rotation list.
Returns
| Type | Description |
|---|---|
| integer | index The index of the current rotation entry. |
GetList
MapRotation.GetList(): MapRotationEntryReturns the full list of map rotation entries.
Returns
| Type | Description |
|---|---|
| MapRotationEntry[] | entries An array of tables, each containing level and mode fields. |