> For the complete documentation index, see [llms.txt](https://docs.idosgames.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.idosgames.com/start/frequently-used-functions.md).

# Frequently Used Functions

1. After successfully installing iDos Games SDK, copy the **Login** and **Main** scenes to your project folder and set the **Login scene first** and **Main scene second**.

<div data-full-width="false"><figure><img src="/files/R5NmHoRfQzMACn7Gbm5m" alt=""><figcaption></figcaption></figure></div>

2. The **Login** and **Main scenes** already contain all the scripts and components to ensure everything works out of the box. The **Login scene** is where the player registers or logs in, and then transitions to the **Main scene**.

<figure><img src="/files/hDPkNTqAavjdUKMeFW1X" alt=""><figcaption></figcaption></figure>

3. You can simply hide unnecessary functionality from the SDK from the **UI in the Main Canvas**.

## Rewards

Any good game needs to **reward players** for specific actions or rewards. The SDK includes ready-made functionality for implementing rewards, you can view them by clicking the **"Reward" button**.

<figure><img src="/files/344O6nNyIWLvMIgWNbRe" alt=""><figcaption></figcaption></figure>

## **ClaimRewardSystem**

If you are writing your own reward implementation, you can use the **ClaimRewardSystem** class in your code.

#### ClaimCoinReward

```
// Player reward in Coins (soft currency) and event points
int coinReward = 1000;
int eventPoint = 1;
ClaimRewardSystem.ClaimCoinReward(coinReward, eventPoint)
```

#### ClaimTokenReward (VIP)

```
// Player reward in Tokens (hard currency) and event points. Players who have VIP status can call.
int tokenReward = 100;
int eventPoint = 1;
ClaimRewardSystem.ClaimTokenReward(tokenReward, eventPoint)
```

#### ClaimSkinProfit (VIP)

```
// Player receive rewards in tokens if they wear skins that generate income in tokens. VIP only
ClaimRewardSystem.ClaimSkinProfit()
```

## UserInventory

In this class, you can get data about the user's inventory. How many items, currency, spins, and chests the user has.

```
// Get the number of items by itemID (string)
int itemAmount = UserInventory.GetItemAmount(itemID);

// Get the amount of currency by VirtualCurrencyID
int currencyAmount = UserInventory.GetVirtualCurrencyAmount(VirtualCurrencyID.CO);

// Get the number of tickets by SpinTicketType
int ticketAmount = UserInventory.GetSpinTicketAmount(SpinTicketType.Standard);

// Get the number of key fragments based on ChestKeyFragmentType. To open the chest, you need to collect all 3 key fragments.
int commonKey1 = UserInventory.GetChestKeyFragmentAmount(ChestKeyFragmentType.Common_1);

// Get a bool value indicating whether the user is a VIP.
bool isVip = UserInventory.HasVIPStatus

// etc.
```

## UserDataService and IGSUserData

All player data is retrieved and processed in these classes. You can **retrieve data** such as **inventory**, **currencies**, and **other player data**.

```
// Returns the player's inventory
IGSUserData.UserInventory

// Returns player currencies
IGSUserData.Currency

// etc.
```

#### Saving Player Data

If you need to implement saving of custom player data, then use the following methods.

```
// Saving data by key
UserDataService.UpdateCustomUserData("Key1", "Key Value");

// Getting data by key
string value = UserDataService.GetCachedCustomUserData("Key1");
```
