steam.achievements
The Garry's Mod Steam achievements library.
Achievement IDs are the engine ones, from 1 to achievements.count.
Fields
| Name | Type | Description |
|---|---|---|
count | integer | The amount of achievements in Garry's Mod. |
Functions
steam.achievements.exists | Checks if an achievement with the given ID exists. |
steam.achievements.get | Returns information about the achievement with the given ID. |
steam.achievements.getAll | Returns information about all achievements. |
steam.achievements.getProgress | Returns the current progress of the achievement with the given ID. |
steam.achievements.isAchieved | Checks if the achievement with the given ID is achieved. |
#steam.achievements.exists
function steam.achievements.exists(id: integer): boolean
Checks if an achievement with the given ID exists.
Parameters
| Name | Type | Description |
|---|---|---|
id | integer | The ID of the achievement. |
Returns
| Type | Name | Description |
|---|---|---|
boolean | exists | true if the achievement exists, otherwise false. |
#steam.achievements.get
function steam.achievements.get(id: integer): steam.AchievementsInfo | nil
Returns information about the achievement with the given ID.
Parameters
| Name | Type | Description |
|---|---|---|
id | integer | The ID of the achievement. |
Returns
| Type | Name | Description |
|---|---|---|
steam.AchievementsInfo | nil | info | The achievement information, nil if the achievement doesn't exist. |
#steam.achievements.getAll
function steam.achievements.getAll(): steam.AchievementsInfo[], integer
Returns information about all achievements.
Returns
| Type | Name | Description |
|---|---|---|
steam.AchievementsInfo[] | list | The list of all achievements, indexed by their IDs. |
integer | count | The amount of achievements. |
#steam.achievements.getProgress
function steam.achievements.getProgress(id: integer): integer | nil
Returns the current progress of the achievement with the given ID.
One-time achievements have no progress counter, so their progress is 0 until they are achieved.
Parameters
| Name | Type | Description |
|---|---|---|
id | integer | The ID of the achievement. |
Returns
| Type | Name | Description |
|---|---|---|
integer | nil | progress | The progress, equals the goal once the achievement is achieved, nil if the achievement doesn't exist. |
#steam.achievements.isAchieved
function steam.achievements.isAchieved(id: integer): boolean
Checks if the achievement with the given ID is achieved.
Parameters
| Name | Type | Description |
|---|---|---|
id | integer | The ID of the achievement. |
Returns
| Type | Name | Description |
|---|---|---|
boolean | achieved | true if the achievement is achieved, false if not or if it doesn't exist. |