Vehicle (56)

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.

CanBradleyApcTarget

  • 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 BradleyAPC )
{
    Puts("CanBradleyApcTarget was called!");
    return (bool) null;
}

CanDestroyLock

  • Returning a non-null value cancels default behavior.

  • This hook is Carbon-only compatible.

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

Example
object CanDestroyLock(BasePlayer BasePlayer , ModularCar ModularCar , BaseVehicleModule BaseVehicleModule )
{
    Puts("CanDestroyLock was called!");
    return (bool) null;
}

CanHelicopterDropCrate

  • 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 CH47HelicopterAIController )
{
    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 PatrolHelicopterAI )
{
    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 PatrolHelicopterAI )
{
    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 PatrolHelicopterAI , BasePlayer BasePlayer )
{
    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 PatrolHelicopterAI )
{
    Puts("CanHelicopterUseNapalm was called!");
    return (bool) null;
}
  • Useful for canceling the lock action.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

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

Example
object CanLock(BasePlayer BasePlayer , ModularCarCodeLock ModularCarCodeLock , ModularCarCodeLock ModularCarCodeLock )
{
    Puts("CanLock 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 TrainCoupling , TrainCar TrainCar )
{
    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 BasePlayer , CH47HelicopterAIController CH47HelicopterAIController )
{
    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 BradleyAPC )
{
    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 BradleyAPC )
{
    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 BradleyAPC )
{
    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 BradleyAPC )
{
    Puts("OnBradleyApcThink was called!");
    return (object) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is Carbon-only compatible.

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

Example
object OnCodeChange(ModularCarGarage ModularCarGarage , BasePlayer BasePlayer , string String )
{
    Puts("OnCodeChange 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 VehiclePrivilege , BasePlayer BasePlayer )
{
    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 VehiclePrivilege , BasePlayer BasePlayer )
{
    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 VehiclePrivilege , BasePlayer BasePlayer )
{
    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 EngineStorage )
{
    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
void OnEngineStart()
{
    Puts("OnEngineStart was called!");
}
  • 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
void OnEngineStart()
{
    Puts("OnEngineStart was called!");
}
  • 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
void OnEngineStarted()
{
    Puts("OnEngineStarted was called!");
}

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
void OnEngineStarted()
{
    Puts("OnEngineStarted was called!");
}

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
void OnEngineStartFinished()
{
    Puts("OnEngineStartFinished was called!");
}
  • 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 VehicleModuleEngine , 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 VehicleModuleEngine , 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
void OnEngineStop()
{
    Puts("OnEngineStop was called!");
}
  • 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
void OnEngineStopped()
{
    Puts("OnEngineStopped was called!");
}

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 CH47HelicopterAIController )
{
    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 CH47HelicopterAIController )
{
    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 CH47HelicopterAIController )
{
    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 CH47HelicopterAIController )
{
    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 PatrolHelicopterAI )
{
    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 PatrolHelicopterAI , UnityEngine.Vector3 Vector3 , BasePlayer BasePlayer )
{
    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 HelicopterTurret )
{
    Puts("OnHelicopterTarget was called!");
    return (object) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is Carbon-only compatible.

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

Example
object OnLockRemove(ModularCarGarage ModularCarGarage , BasePlayer BasePlayer )
{
    Puts("OnLockRemove 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 MLRS , BasePlayer BasePlayer )
{
    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 MLRS , BasePlayer BasePlayer )
{
    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 MLRS )
{
    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 MLRS , ServerProjectile ServerProjectile )
{
    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 MLRS , UnityEngine.Vector3 Vector3 , MLRS MLRS )
{
    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 MLRS , MLRS MLRS , MLRS MLRS )
{
    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 BaseRidableAnimal , BasePlayer BasePlayer , Item Item )
{
    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 BaseRidableAnimal , BasePlayer BasePlayer )
{
    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 TrainCar , BasePlayer BasePlayer )
{
    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 VehicleModuleSeating , BasePlayer BasePlayer )
{
    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 ModularCarCodeLock )
{
    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 ModularCarGarage , BasePlayer BasePlayer , string String )
{
    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 ModularCarGarage , BasePlayer BasePlayer )
{
    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 BaseVehicleModule , BaseModularVehicle BaseModularVehicle , BasePlayer BasePlayer )
{
    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 ModularCar , Rust.Modular.ItemModVehicleModule[] ItemModVehicleModule[] )
{
    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 ModularCar , Rust.Modular.ItemModVehicleModule[] ItemModVehicleModule[] )
{
    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 Item , ModularCarGarage ModularCarGarage , BasePlayer BasePlayer )
{
    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 Item , ModularCarGarage ModularCarGarage , BasePlayer BasePlayer )
{
    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 BaseVehicle , BasePlayer BasePlayer )
{
    Puts("OnVehiclePush was called!");
    return (object) null;
}

Last updated