RustTip

OnRentableShopOpened

OxideCarbonApartments
void OnRentableShopOpened(RentableShop rentableShop, BasePlayer byPlayer)
Works — the game method in this build is the one the hook was written for.

Parameters

rentableShop
RentableShop
byPlayer
BasePlayer

Return value

voidThe return value is ignored — the hook only notifies.

Example

private void OnRentableShopOpened(RentableShop rentableShop, BasePlayer byPlayer)
{
    Puts("OnRentableShopOpened");
}

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

Injection point

Rust.opj (Oxide)
void RentableShop.OnShopOpened(BasePlayer)

Passes: RentableShop rentableShop, BasePlayer byPlayer

WorksReturnBehavior: ContinueArgumentBehavior: All (this)Assembly-CSharp.dll

Where it is called (this branch's game code)

// …
	nextRentDue = 3600f;
	InvokeRepeating(DeductRent, 60f, 60f);
	int num = Mathf.RoundToInt((float)InitialScrapFee * CurrentRentMultiplier);
	int openScrapCost = num;
	byPlayer.inventory.UseAmount(ItemManager.Items.Scrap, num);
	int num2 = Mathf.RoundToInt((float)ScrapPerHourRent * 12f * CurrentRentMultiplier);
	byPlayer.inventory.MoveItemsIntoContainer(ItemManager.Items.Scrap, num2, invisibleVendingMachine.inventory);
	Analytics.Azure.OnShopOpened(this, openScrapCost, num2);
Interface.CallHook("OnRentableShopOpened", this, byPlayer);
}

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.