From GMod Wiki
Library used by the game to display the achievements.
Library Functions
achievements.BalloonPopped
achievements.Count
achievements.EatBall
achievements.GetCount
achievements.GetDesc
achievements.GetGoal
achievements.GetName
achievements.IncBaddies
achievements.IncBystander
achievements.IncGoodies
achievements.IsAchieved
achievements.Remover
achievements.SpawnMenuOpen
achievements.SpawnedNPC
achievements.SpawnedProp
achievements.SpawnedRagdoll
Examples
Description | Good use of all of these concepts. |
Used on | |
Code | local achievmentsID, count, goal, achieved, desc, name = achievements.Count()
for achievmentsID = 1, achievmentsID do
count = achievements.GetCount(achievementsID)
goal = achievements.GetGoal(achievementsID)
achieved = achievements.IsAchieved(achievementsID)
desc = achievements.GetDesc(achievementsID)
name = achievements.GetName(achievementsID)
print(count, goal, achieved, desc, name)
end |
Output | N/A |
Description | Prints all of the achieved achievements to the chat area! |
Used on | |
Code |
for AchievementNum = 1, achievements.Count() do
--[[
Keep incrementing "AchievementNum" by 1,
until we reach the achivements count/number
--]]
if achievements.IsAchieved( AchievementNum ) then
chat.AddText( Color(0,255,0), achievements.GetName( AchievementNum ) .. " is achieved!" )
--[[
Checks if the achievement with the current id is achieved!
prints the achievement's name plus the string "is achieved!"
"is achieved!" in green to the chat area (seen by client only)
--]]
end
end
|
Output | N/A |