Rewrite of the popular Kits plugin for Rust.
The following commands are currently available.
The list command allows players to view kits available to them.
The kits which the user has permission for are displayed.
/kit
The redeem command allows players to redeem a kit, if they're eligible.
Argument Name | Description |
---|---|
name |
The name of the kit. |
The permission for the kit is required.
/kit <name>
/kit example
The create command creates a new kit based off the items in your inventory.
Note, the
name
may only contain letters.
Argument Name | Description |
---|---|
name |
The name for the kit. |
The permission kits.admin
is required.
/kit create <name>
/kit create example
The cooldown command sets the minimum time between redemptions for a kit.
Argument Name | Description |
---|---|
name |
The name of the kit. |
time |
The minimum time. |
The permission kits.admin
is required.
/kit cooldown <name> <time>
Note, the
time
argument is parsed in a versatile way, if it's human readable it should be fine.
/kit cooldown example 3 days 1 hour 4 minutes 1 second
The duplicate command duplicates a kit.
Argument Name | Description |
---|---|
name |
The name of the kit. |
newName |
The name of the new kit. |
The permission kits.admin
is required.
/kit duplicate <name> <newName>
/kit duplicate example test
The give command gives a kit to the player
or all players if no player
argument is provided.
Argument Name | Description | Required |
---|---|---|
name |
The name of the kit. | True |
player |
The player. | False |
The permission kits.admin
is required.
/kit give <name> <player>
/kit give example Jacob
/kit give example
The limit command sets the maximum amount of redemptions, per player.
Argument Name | Description |
---|---|
name |
The name of the kit. |
amount |
The redemption limit. |
The permission kits.admin
is required.
/kit limit <name> <amount>
/kit limit example 3
The remove command removes a kit.
Argument Name | Description |
---|---|
name |
The name of the kit. |
The permission kits.admin
is required.
/kit remove <name>
/kit remove example
The rename command renames a kit.
Argument Name | Description |
---|---|
name |
The name of the kit. |
newName |
The new name of the kit. |
The permission kits.admin
is required.
/kit rename <name> <newName>
/kit rename example test
The update command sets a kit's items to those in your inventory.
Argument Name | Description |
---|---|
name |
The name of the kit. |
The permission kits.admin
is required.
/kit update <name>
/kit update example
{
"Default kits (lowest to highest priority)": [],
"Wipe player data on new save (true/false)": true
}
Simply enter the names of kits to spawn with. When a player respawns, the last one they have permission to use will be given.
Head over to the releases and download the latest version, then simply follow this guide.
If found in the data directory, data from the previous version of Kits is automatically migrated to the new schema. It's important to note that permissions and default kits have been updated. To ensure a good user experience for players it's suggested you read the corresponding sections after updating and act accordingly.
The permission kits.admin
is required to use most commands. For every kit that's created a corresponding permission is registered, following the pattern kits.<name>
, where name
is the name of the kit. A guide on using Oxide's permission system can be found here.
The following API methods are currently available.
The following hooks are currently called by Kits.
GiveKit
gives a kit to the player
.
Argument Name | Type | Description |
---|---|---|
player |
BasePlayer |
The player. |
name |
string |
The name of the kit. |
GiveKit(BasePlayer player, string name)
Kits.Call("GiveKit", player, "example");
IsKit
returns whether a kit exists by the name
.
Argument Name | Type | Description |
---|---|---|
name |
string |
The name of the kit. |
IsKit(string name)
var isKit = Kits.Call<bool>("IsKit", "example");
IsKitRedeemable
returns whether the player
can use the kit, taking into account permissions, limits, and cooldowns.
Argument Name | Type | Description |
---|---|---|
player |
BasePlayer |
The player. |
name |
string |
The name of the kit. |
IsKitRedeemable(BasePlayer player, string name)
var isRedeemable = Kits.Call<bool>("IsKitRedeemable", player, "example");
CanGiveDefaultKit
allows other plugins to intercept Kits giving default kits.
Parameter Name | Type | Description | Required |
---|---|---|---|
player |
BasePlayer |
The player. | True |
name |
string |
The name of the kit. | False |
Return a non-null value to override default behavior.
private object CanGiveDefaultKit(BasePlayer player) => blockAllKits
? false
: (object)null;
Note, the overload with the
name
parameter will override the one without, as it's more specific.
private object CanGiveDefaultKit(BasePlayer player, string name) => name == "blocked"
? false
: (object)null;
CanRedeemKit
allows other plugins to intercept kit redemption.
Parameter Name | Type | Description | Required |
---|---|---|---|
player |
BasePlayer |
The player. | True |
name |
string |
The name of the kit. | False |
Return a non-null value to override default behavior, specifically a string if you'd like to send a message to the player
.
private object CanRedeemKit(BasePlayer player) => blockAllKits
? $"{Title} is preventing you from using that kit."
: null;
Note, the overload with the
name
parameter will override the one without, as it's more specific.
private object CanRedeemKit(BasePlayer player, string name) => name == "blocked"
? $"{Title} is preventing you from using that kit."
: null;
See ApiExample.cs for more context.
Kits is free and open-source software, simply open a pull request.