Added Stats.Set

This commit is contained in:
Garry Newman 2017-06-25 11:44:26 +01:00
parent 0a115f8ea4
commit 3002419af0

View File

@ -59,6 +59,38 @@ public double GetGlobalFloat( string name )
return data;
}
/// <summary>
/// Set a stat value. This will automatically call StoreStats() after a successful call
/// unless you pass false as the last argument.
/// </summary>
public bool Set( string name, int value, bool store = true )
{
var r = client.native.userstats.SetStat( name, value );
if ( store )
{
return r && client.native.userstats.StoreStats();
}
return r;
}
/// <summary>
/// Set a stat value. This will automatically call StoreStats() after a successful call
/// unless you pass false as the last argument.
/// </summary>
public bool Set( string name, float value, bool store = true )
{
var r = client.native.userstats.SetStat0( name, value );
if ( store )
{
return r && client.native.userstats.StoreStats();
}
return r;
}
public void Dispose()
{
client = null;