steam_get_achievement

Check to see if an achievement has been awarded.

Syntax:

steam_get_achievement(ach_name);


Argument Description
ach_name The name of the achievement to get (string).


Returns: Boolean


Description

With this function you can check the Steam API to see if a specific achievement has been awarded. The achievement should have been previously defined on the Steamworks control panel accounts page for your game and the string that is passed to the function should match that used as the API Name on the control panel.


Example:

if hp <= 0
   {
   global.Deaths += 1;
   if global.Deaths == 10
      {
      if !steam_get_achievement("ach_Player_Dies_Ten_Times") steam_set_achievement("ach_Player_Dies_Ten_Times");
      }
   }

The above code will reward the player an achievement if the global variable "Deaths" is equal to 10 and if the achievement has not already been awarded.


Back: Steam API
Next: steam_clear_achievement
© Copyright YoYo Games Ltd. 2018 All Rights Reserved