xboxlive_stats_delete_stat


Description

This function can be used to delete a stat from the stat manager for the given user ID. You supply the user ID as returned by (for example) the function xboxlive_get_user(), then the stat string to delete. This clears the stat value and removed it from the stat manager, meaning it will no longer be returned by the functions xboxlive_stats_get_stat_names or xboxlive_stats_get_stat.

The function will will return -1 if there was an error or the user ID is invalid, or any other value if the function was successfully called

IMPORTANT! This function is only valid when exporting using the UWP target for the Xbox One and it requires you to have checked the Enable XBox Live option in the UWP Game Options.


Syntax:

xboxlive_stats_delete_stat(user_id, stat);

Argument Description
user_id The user ID pointer to delete the stat of
stat The statistic to delete (a string)


Returns:

Real


Example:

for(var i = 0; i < xboxlive_get_user_count(); i++;)
    {
    user_id[i] = xboxlive_get_user(i);
    xboxlive_stats_delete_stat(user_id[i], "HighScore");
    }

The above code loops through the connected users and deletes the specified stat from the stat manager for each one.