RustTip

OnPickupFromRack

CarbonGlobal

Called to control taking items from a weapon rack.

void OnPickupFromRack(WeaponRack rack, BasePlayer player, Item item, int mountSlotIndex, int playerBeltIndex, bool tryHold)
Works — the game method in this build is the one the hook was written for.

Parameters

rack
WeaponRack
player
BasePlayer
item
Item
mountSlotIndex
int
playerBeltIndex
int
tryHold
bool

Return value

voidThe return value is ignored — the hook only notifies.

Example

private void OnPickupFromRack(WeaponRack rack, BasePlayer player, Item item, int mountSlotIndex, int playerBeltIndex, bool tryHold)
{
    Puts("OnPickupFromRack");
}

Works in both Oxide and Carbon: Carbon loads Oxide plugins as is.

Injection point

Carbon
void WeaponRack.GivePlayerWeapon(BasePlayer player, int mountSlotIndex, int playerBeltIndex, bool tryHold, bool sendUpdate)
WorksAssembly-CSharp

Sources: Rust.opj from OxideMod/Oxide.Rust (MIT) and hook metadata of the Carbon documentation (MIT). Method code is decompiled from this branch's server.