dreamworkAPI
Ctrl K
GitHub
libraryDocs / steam / achievements

steam.achievements

libraryclientmenusource

The Garry's Mod Steam achievements library.

Achievement IDs are the engine ones, from 1 to achievements.count.

Fields

NameTypeDescription
countintegerThe amount of achievements in Garry's Mod.

Functions

steam.achievements.existsChecks if an achievement with the given ID exists.
steam.achievements.getReturns information about the achievement with the given ID.
steam.achievements.getAllReturns information about all achievements.
steam.achievements.getProgressReturns the current progress of the achievement with the given ID.
steam.achievements.isAchievedChecks if the achievement with the given ID is achieved.

#steam.achievements.exists

clientmenunodiscardsource
function steam.achievements.exists(id: integer): boolean

Checks if an achievement with the given ID exists.

Parameters
NameTypeDescription
idintegerThe ID of the achievement.
Returns
TypeNameDescription
booleanexiststrue if the achievement exists, otherwise false.

#steam.achievements.get

clientmenunodiscardsource
function steam.achievements.get(id: integer): steam.AchievementsInfo | nil

Returns information about the achievement with the given ID.

Parameters
NameTypeDescription
idintegerThe ID of the achievement.
Returns
TypeNameDescription
steam.AchievementsInfo | nilinfoThe achievement information, nil if the achievement doesn't exist.

#steam.achievements.getAll

clientmenunodiscardsource
function steam.achievements.getAll(): steam.AchievementsInfo[], integer

Returns information about all achievements.

Returns
TypeNameDescription
steam.AchievementsInfo[]listThe list of all achievements, indexed by their IDs.
integercountThe amount of achievements.

#steam.achievements.getProgress

clientmenunodiscardsource
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
NameTypeDescription
idintegerThe ID of the achievement.
Returns
TypeNameDescription
integer | nilprogressThe progress, equals the goal once the achievement is achieved, nil if the achievement doesn't exist.

#steam.achievements.isAchieved

clientmenunodiscardsource
function steam.achievements.isAchieved(id: integer): boolean

Checks if the achievement with the given ID is achieved.

Parameters
NameTypeDescription
idintegerThe ID of the achievement.
Returns
TypeNameDescription
booleanachievedtrue if the achievement is achieved, false if not or if it doesn't exist.
Generated from the dreamwork meta branch.