An open API service indexing awesome lists of open source software.

https://github.com/monah-rasta/inventorybackup

Oxide plugin for Rust. Allows to save and restore players inventories
https://github.com/monah-rasta/inventorybackup

oxide plugin rust

Last synced: 3 months ago
JSON representation

Oxide plugin for Rust. Allows to save and restore players inventories

Awesome Lists containing this project

README

        

# InventoryBackup
Oxide plugin for Rust. Allows to save and restore players inventories

Plugin adds the ability to save and restore players inventories.

## Permissions

* `inventorybackup.use` -- Allows player to to save and restore players inventories

## Configuration

```json
{
"Storage duration (days)": -1.0,
"Clear inventories data on wipe": false,
"Logging enabled": false,
"Chat steamID icon": 0,
"Commands list": [
"invbackup"
]
}
```

## Localization

```json
{
"Error.Failed": "Operation failed!",
"Error.NoPermission": "You do not have permission to use this command!",
"Format.Prefix": "[Inventory Backup]: ",
"Info.Success": "Operation completed successfully!",
"Error.Syntax": "Syntax error occured!\n/{0} save - Save player inventory\n/{0} restore - Restore saved player inventory\n/{0} remove - Remove saved player inventory\n"
}
```

## Developer API

### InventorySave

Used to save player inventory.

```csharp
bool InventorySave(ulong userID, string inventoryName)
```

* **Example**:
```csharp
if (InventoryBackup != null && InventoryBackup.IsLoaded)
{
object resultCall = InventoryBackup.Call("InventorySave", player.userID, Name);

if (resultCall is bool && (bool)resultCall)
{
Puts("Inventory saved");
}
}
```

### InventoryRestore

Used to restore player inventory. Use `remove` to remove saved inventory after restoration.

```csharp
bool InventoryRestore(ulong userID, string inventoryName, bool remove = false)
```

* **Example**:
```csharp
if (InventoryBackup != null && InventoryBackup.IsLoaded)
{
object resultCall = InventoryBackup.Call("InventoryRestore", player.userID, Name, true);

if (resultCall is bool && (bool)resultCall)
{
Puts("Inventory restored");
}
}
```

### InventoryRemove

Used to remove player inventory.

```csharp
bool InventoryRemove(ulong userID, string inventoryName)
```

* **Example**:
```csharp
if (InventoryBackup != null && InventoryBackup.IsLoaded)
{
InventoryBackup.Call("InventoryRemove", player.userID, Name);
}
```