Delete

You should always make sure that you are calling these events after the rcore_stats script is initialized.

To make sure, check the Step 1 in the Integration guide.

Delete order

When deleting any data using API events, you must make sure to follow a certain order.

Reason for this is that some data is dependent on other data.

Achievements are dependent on stat types, and stat types are dependent on categories. If you try to delete a category first and some stat type will depend on it, you will get an SQL error.

Correct order:

  1. Delete achievement

  2. Delete stat type

  3. Delete category

Delete Events

All events are SERVER SIDE.

Deleting achievements

-- @param key string - unique key of the achievement
TriggerEvent('rcore_stats:api:deleteAchievement', key)

-- Example to delete the achievement "basket_hoops_1"
TriggerEvent('rcore_stats:api:deleteAchievement', "basket_hoops_1")

Deleting stat types

-- @param key string - unique key of the stat type
TriggerEvent('rcore_stats:api:deleteStatType', key)

-- Example to delete the stat type "total_basket_hoops"
TriggerEvent('rcore_stats:api:deleteStatType', "total_basket_hoops")

Deleting categories

-- @param key string - unique key of the category
TriggerEvent('rcore_stats:api:deleteCategory', key)

-- Example to delete the category "minigames"
TriggerEvent('rcore_stats:api:deleteCategory', "minigames")

Last updated