Namespace: Steamworks

Lua
C++
Edit

GetStat

This function gets a statistic for the user for this game.

Syntax

Returns

Returns the statistic value, or -1 if the value cannot be retrieved.

Example

#include "UltraEngine.h"
#include "Steamworks/Steamworks.h"

using namespace UltraEngine;

int main(int argc, const char* argv[])
{
    if (not Steamworks::Initialize())
    {
        RuntimeError("Steamworks failed to initialize.");
        return 1;
    }

    //Retrieve the current value
    int value = Steamworks::GetStat("NumWins");
    Print(value);

    //Set a new value
    Steamworks::SetStat("NumWins", 105);

    Steamworks::Shutdown();
    return 0;
}
Copyright © 2006-2025 Ultra Software.
All rights reserved.
Leadwerks 4 Documentation