Vehicle (52)

All currently available hooks that are found in Carbon. Most hooks would be ones compatible with Oxide, although there are Carbon-only ones as well.

  • Called when an APC targets an entity.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BradleyAPC.VisibilityTest of Assembly-CSharp.dll.

Example
object CanBradleyApcTarget(BradleyAPC self)
{
    Puts("CanBradleyApcTarget was called!");
    return (bool) null;
}
  • Called when a CH47 helicopter attempts to drop a crate.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches CH47HelicopterAIController.CanDropCrate of Assembly-CSharp.dll.

Example
object CanHelicopterDropCrate(CH47HelicopterAIController self)
{
    Puts("CanHelicopterDropCrate was called!");
    return (bool) null;
}
  • Called when a patrol helicopter attempts to strafe.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches PatrolHelicopterAI.CanStrafe of Assembly-CSharp.dll.

Example
object CanHelicopterStrafe(PatrolHelicopterAI self)
{
    Puts("CanHelicopterStrafe was called!");
    return (bool) null;
}
  • Called when a patrol helicopter attempts to target a player to attack while strafing.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches PatrolHelicopterAI.ValidRocketTarget of Assembly-CSharp.dll.

Example
object CanHelicopterStrafeTarget(PatrolHelicopterAI self)
{
    Puts("CanHelicopterStrafeTarget was called!");
    return (bool) null;
}
  • Called when a patrol helicopter attempts to target a player to attack.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches PatrolHelicopterAI.PlayerVisible of Assembly-CSharp.dll.

Example
object CanHelicopterTarget(PatrolHelicopterAI self, BasePlayer ply)
{
    Puts("CanHelicopterTarget was called!");
    return (bool) null;
}
  • Called when a patrol helicopter attempts to use napalm.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches PatrolHelicopterAI.CanUseNapalm of Assembly-CSharp.dll.

Example
object CanHelicopterUseNapalm(PatrolHelicopterAI self)
{
    Puts("CanHelicopterUseNapalm was called!");
    return (bool) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches TrainCoupling.TryCouple of Assembly-CSharp.dll.

Example
object CanTrainCarCouple(TrainCoupling self, TrainCar owner)
{
    Puts("CanTrainCarCouple was called!");
    return (bool) null;
}
  • Useful for denying to mount a CH47 helicopter.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches CH47HelicopterAIController.AttemptMount of Assembly-CSharp.dll.

Example
object CanUseHelicopter(BasePlayer player, CH47HelicopterAIController self)
{
    Puts("CanUseHelicopter was called!");
    return (object) null;
}
  • Called when generating ocean patrol path for CargoShip.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseBoat.GenerateOceanPatrolPath of Assembly-CSharp.dll.

Example
object OnBoatPathGenerate()
{
    Puts("OnBoatPathGenerate was called!");
    return (List<UnityEngine.Vector3>) null;
}
  • Called when an APC starts hunting.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BradleyAPC.UpdateMovement_Hunt of Assembly-CSharp.dll.

Example
object OnBradleyApcHunt(BradleyAPC self)
{
    Puts("OnBradleyApcHunt was called!");
    return (object) null;
}
  • Called when an APC initializes.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BradleyAPC.Initialize of Assembly-CSharp.dll.

Example
object OnBradleyApcInitialize(BradleyAPC self)
{
    Puts("OnBradleyApcInitialize was called!");
    return (object) null;
}
  • Called when an APC is starts patrolling.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BradleyAPC.UpdateMovement_Patrol of Assembly-CSharp.dll.

Example
object OnBradleyApcPatrol(BradleyAPC self)
{
    Puts("OnBradleyApcPatrol was called!");
    return (object) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BradleyAPC.DoSimpleAI of Assembly-CSharp.dll.

Example
object OnBradleyApcThink(BradleyAPC self)
{
    Puts("OnBradleyApcThink was called!");
    return (object) null;
}
  • Called when a cupboard attempts to authorize a player.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VehiclePrivilege.AddSelfAuthorize of Assembly-CSharp.dll.

Example
object OnCupboardAuthorize(VehiclePrivilege self, BasePlayer player)
{
    Puts("OnCupboardAuthorize was called!");
    return (object) null;
}
  • Called when an attempt is made to clear a cupboard authorized list.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VehiclePrivilege.ClearList of Assembly-CSharp.dll.

Example
object OnCupboardClearList(VehiclePrivilege self, BasePlayer player)
{
    Puts("OnCupboardClearList was called!");
    return (object) null;
}
  • Called when a cupboard attempts to deauthorize a player.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VehiclePrivilege.RemoveSelfAuthorize of Assembly-CSharp.dll.

Example
object OnCupboardDeauthorize(VehiclePrivilege self, BasePlayer player)
{
    Puts("OnCupboardDeauthorize was called!");
    return (object) null;
}
  • Called before engine loadout data is refreshed.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches EngineStorage.RefreshLoadoutData of Assembly-CSharp.dll.

Example
object OnEngineLoadoutRefresh(Rust.Modular.EngineStorage self)
{
    Puts("OnEngineLoadoutRefresh was called!");
    return (object) null;
}
  • Called when a player tries to start a vehicle engine.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches MotorRowboat.EngineToggle of Assembly-CSharp.dll.

Example
object OnEngineStart()
{
    Puts("OnEngineStart was called!");
    return (object) null;
}
  • Called when a player tries to start a vehicle engine.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VehicleEngineController`1.TryStartEngine of Assembly-CSharp.dll.

Example
object OnEngineStart()
{
    Puts("OnEngineStart was called!");
    return (object) null;
}
  • Called right after a vehicle engine has started.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches MotorRowboat.EngineToggle of Assembly-CSharp.dll.

Example
object OnEngineStarted()
{
    Puts("OnEngineStarted was called!");
    return (object) null;
}

This hook requires OnEngineStart [MotorRowboat], which loads alongside OnEngineStarted.

  • Called right after a vehicle engine has started.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VehicleEngineController`1.TryStartEngine of Assembly-CSharp.dll.

Example
object OnEngineStarted()
{
    Puts("OnEngineStarted was called!");
    return (object) null;
}

This hook requires OnEngineStart, which loads alongside OnEngineStarted.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VehicleEngineController`1.FinishStartingEngine of Assembly-CSharp.dll.

Example
object OnEngineStartFinished()
{
    Puts("OnEngineStartFinished was called!");
    return (object) null;
}
  • Called right before the stats of a modular car engine are refreshed.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VehicleModuleEngine.RefreshPerformanceStats of Assembly-CSharp.dll.

Example
object OnEngineStatsRefresh(VehicleModuleEngine self, Rust.Modular.EngineStorage engineStorage)
{
    Puts("OnEngineStatsRefresh was called!");
    return (object) null;
}
  • Called right after the stats of a modular car engine are refreshed.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VehicleModuleEngine.RefreshPerformanceStats of Assembly-CSharp.dll.

Example
void OnEngineStatsRefreshed(VehicleModuleEngine self, Rust.Modular.EngineStorage engineStorage)
{
    Puts("OnEngineStatsRefreshed was called!");
}

This hook requires OnEngineStatsRefresh, which loads alongside OnEngineStatsRefreshed.

  • Called when a vehicle engine is about to stop.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VehicleEngineController`1.StopEngine of Assembly-CSharp.dll.

Example
object OnEngineStop()
{
    Puts("OnEngineStop was called!");
    return (object) null;
}
  • Called right after a vehicle engine has stopped.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VehicleEngineController`1.StopEngine of Assembly-CSharp.dll.

Example
object OnEngineStopped()
{
    Puts("OnEngineStopped was called!");
    return (object) null;
}

This hook requires OnEngineStop, which loads alongside OnEngineStopped.

  • Called when a CH47 helicopter is being attacked.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches CH47HelicopterAIController.OnAttacked of Assembly-CSharp.dll.

Example
object OnHelicopterAttack(CH47HelicopterAIController self)
{
    Puts("OnHelicopterAttack was called!");
    return (object) null;
}
  • Called when a CH47 helicopter is dropping a crate.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches CH47HelicopterAIController.DropCrate of Assembly-CSharp.dll.

Example
void OnHelicopterDropCrate(CH47HelicopterAIController self)
{
    Puts("OnHelicopterDropCrate was called!");
}
  • Called when a CH47 helicopter is opening its drop door.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches CH47HelicopterAIController.SetDropDoorOpen of Assembly-CSharp.dll.

Example
object OnHelicopterDropDoorOpen(CH47HelicopterAIController self)
{
    Puts("OnHelicopterDropDoorOpen was called!");
    return (object) null;
}
  • Called when a CH47 helicopter runs out of crates.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches CH47HelicopterAIController.OutOfCrates of Assembly-CSharp.dll.

Example
object OnHelicopterOutOfCrates(CH47HelicopterAIController self)
{
    Puts("OnHelicopterOutOfCrates was called!");
    return (bool) null;
}
  • Called before the patrol helicopter starts leaving the map.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches PatrolHelicopterAI.Retire of Assembly-CSharp.dll.

Example
object OnHelicopterRetire(PatrolHelicopterAI self)
{
    Puts("OnHelicopterRetire was called!");
    return (object) null;
}
  • Called when helicopter is entering strafe.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches PatrolHelicopterAI.StartStrafe of Assembly-CSharp.dll.

Example
object OnHelicopterStrafeEnter(PatrolHelicopterAI self, UnityEngine.Vector3 position, BasePlayer strafeTarget)
{
    Puts("OnHelicopterStrafeEnter was called!");
    return (object) null;
}
  • Called when a helicopter turret attempts to target an entity.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches HelicopterTurret.SetTarget of Assembly-CSharp.dll.

Example
object OnHelicopterTarget(HelicopterTurret self)
{
    Puts("OnHelicopterTarget was called!");
    return (object) null;
}
  • Called just before the MLRS is fired.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches MLRS.Fire of Assembly-CSharp.dll.

Example
object OnMlrsFire(MLRS self, BasePlayer owner)
{
    Puts("OnMlrsFire was called!");
    return (object) null;
}
  • Called just after the MLRS has been fired.

  • No return behaviour.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches MLRS.Fire of Assembly-CSharp.dll.

Example
void OnMlrsFired(MLRS self, BasePlayer owner)
{
    Puts("OnMlrsFired was called!");
}

This hook requires OnMlrsFire, which loads alongside OnMlrsFired.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches MLRS.EndFiring of Assembly-CSharp.dll.

Example
void OnMlrsFiringEnded(MLRS self)
{
    Puts("OnMlrsFiringEnded was called!");
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches MLRS.FireNextRocket of Assembly-CSharp.dll.

Example
void OnMlrsRocketFired(MLRS self, ServerProjectile local7)
{
    Puts("OnMlrsRocketFired was called!");
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches MLRS.SetUserTargetHitPos of Assembly-CSharp.dll.

Example
object OnMlrsTarget(MLRS self, UnityEngine.Vector3 worldPos, MLRS self1)
{
    Puts("OnMlrsTarget was called!");
    return (object) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches MLRS.SetUserTargetHitPos of Assembly-CSharp.dll.

Example
void OnMlrsTargetSet(MLRS self, MLRS self1, MLRS self2)
{
    Puts("OnMlrsTargetSet was called!");
}

This hook requires OnMlrsTarget, which loads alongside OnMlrsTargetSet.

  • Called when a player tries to claim a horse.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseRidableAnimal.RPC_Claim of Assembly-CSharp.dll.

Example
object OnRidableAnimalClaim(BaseRidableAnimal self, BasePlayer local0, Item local2)
{
    Puts("OnRidableAnimalClaim was called!");
    return (object) null;
}
  • Called after a player has claimed a horse.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseRidableAnimal.RPC_Claim of Assembly-CSharp.dll.

Example
void OnRidableAnimalClaimed(BaseRidableAnimal self, BasePlayer local0)
{
    Puts("OnRidableAnimalClaimed was called!");
}

This hook requires OnRidableAnimalClaim, which loads alongside OnRidableAnimalClaimed.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches TrainCar.RPC_WantsUncouple of Assembly-CSharp.dll.

Example
object OnTrainCarUncouple(TrainCar self, BasePlayer player)
{
    Puts("OnTrainCarUncouple was called!");
    return (object) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches VehicleModuleSeating.PlayerServerInput of Assembly-CSharp.dll.

Example
void OnVehicleHornPressed(VehicleModuleSeating self, BasePlayer player)
{
    Puts("OnVehicleHornPressed was called!");
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ModularCarCodeLock.CanHaveALock of Assembly-CSharp.dll.

Example
object OnVehicleLockableCheck(ModularCarCodeLock self)
{
    Puts("OnVehicleLockableCheck was called!");
    return (bool) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ModularCarGarage.RPC_RequestAddLock of Assembly-CSharp.dll.

Example
object OnVehicleLockRequest(ModularCarGarage self, BasePlayer local0, string local1)
{
    Puts("OnVehicleLockRequest was called!");
    return (object) null;
}
  • Called right after a player deselects a vehicle module item in a car's inventory.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ModularCarGarage.RPC_DeselectedLootItem of Assembly-CSharp.dll.

Example
void OnVehicleModuleDeselected(ModularCarGarage self, BasePlayer local0)
{
    Puts("OnVehicleModuleDeselected was called!");
}
  • Called when a player tries to move a vehicle module item that is currently on a vehicle.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseModularVehicle.CanMoveFrom of Assembly-CSharp.dll.

Example
object OnVehicleModuleMove(BaseVehicleModule local0, BaseModularVehicle self, BasePlayer player)
{
    Puts("OnVehicleModuleMove was called!");
    return (bool) null;
}
  • Called right after a modular car has spawned, but before module items are added to its inventory from a preset.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ModularCar.SpawnPreassignedModules of Assembly-CSharp.dll.

Example
object OnVehicleModulesAssign(ModularCar self, Rust.Modular.ItemModVehicleModule[] socketItemDefs)
{
    Puts("OnVehicleModulesAssign was called!");
    return (object) null;
}
  • Called right after a car has spawned and its module inventory has been filled with module items from a preset.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ModularCar.SpawnPreassignedModules of Assembly-CSharp.dll.

Example
void OnVehicleModulesAssigned(ModularCar self, Rust.Modular.ItemModVehicleModule[] socketItemDefs)
{
    Puts("OnVehicleModulesAssigned was called!");
}

This hook requires OnVehicleModulesAssign, which loads alongside OnVehicleModulesAssigned.

  • Called right after a player has selected a vehicle module item in a car inventory, but before they are shown the corresponding storage container.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ModularCarGarage.RPC_SelectedLootItem of Assembly-CSharp.dll.

Example
object OnVehicleModuleSelect(Item local2, ModularCarGarage self, BasePlayer local0)
{
    Puts("OnVehicleModuleSelect was called!");
    return (object) null;
}
  • Called right after a player has selected a vehicle module item in a car's inventory, and after they have been shown the corresponding storage container if applicable.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ModularCarGarage.RPC_SelectedLootItem of Assembly-CSharp.dll.

Example
void OnVehicleModuleSelected(Item local2, ModularCarGarage self, BasePlayer local0)
{
    Puts("OnVehicleModuleSelected was called!");
}

This hook requires OnVehicleModuleSelect, which loads alongside OnVehicleModuleSelected.

  • Called when a player tries to push a vehicle.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseVehicle.RPC_WantsPush of Assembly-CSharp.dll.

Example
object OnVehiclePush(BaseVehicle self, BasePlayer player)
{
    Puts("OnVehiclePush was called!");
    return (object) null;
}

Last updated