RustTip

OnApartmentRoomBreakInComplete

OxideCarbonApartments
object OnApartmentRoomBreakInComplete(ApartmentRoom local1, BasePlayer player, ApartmentDoor apartmentDoor)
Method changed — check — the game method differs from the one the hook is recorded for in Oxide. The hook is still called, but its place may have shifted — worth checking after an update.

Parameters

local1
ApartmentRoom
player
BasePlayer
apartmentDoor
ApartmentDoor

Return value

objectReturn non-null to cancel the game action.

Example

object — you can affect the game: return a value to change or cancel the action.

private object OnApartmentRoomBreakInComplete(ApartmentRoom local1, BasePlayer player, ApartmentDoor apartmentDoor)
{
    Puts("OnApartmentRoomBreakInComplete");

    // change nothing — the game continues as usual
    return null;

    // to affect the game:
    // return false; // non-null cancels the game action
}

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

Injection point

Rust.opj (Oxide)
void ApartmentDoor.CompleteBreakIn(BasePlayer)

Passes: ApartmentRoom local1, BasePlayer player, ApartmentDoor apartmentDoor

Method changed — checkReturnBehavior: ExitWhenValidTypeArgumentBehavior: UseArgumentString (l1, a0, this)Assembly-CSharp.dll

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

// …
}
breakInStarts.Remove(player.userID);
SetBreakInAnimation3rdPerson(player, state: false);
if ((float)value < ApartmentCommands.breakinseconds * 0.9f)
{
	return;
}
ApartmentRoom apartmentRoom = BaseNetworkable.serverEntities.Find(ApartmentId) as ApartmentRoom;
if (Interface.CallHook("OnApartmentRoomBreakInComplete", apartmentRoom, player, this) != null)
{
	return;
}
if (!apartmentRoom.IsCurrentlyRented())
{
	player.ShowToast(GameTip.Styles.Red_Normal, Phrase_BreakInUnoccupied, false);
	return;
}
// …

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.