Skip to content

OnVehicleLockRequest

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private void OnVehicleLockRequest( ModularCarGarage instance, BasePlayer player, string text )
{
    Puts( "OnVehicleLockRequest works!" );
}

Location

  • ModularCarGarage::RPC_RequestAddLock(BaseEntity/RPCMessage msg)
csharp
//---
	if (player == null)
	{
		return;
	}
	string text = msg.read.String(256, false);
	if (Interface.CallHook("OnVehicleLockRequest", this, player, text) != null)
	{
		return;
	}
	ItemAmount itemAmount = this.lockResourceCost;
	if ((float)player.inventory.GetAmount(itemAmount.itemDef.itemid) >= itemAmount.amount && this.carOccupant.CarLock.TryAddALock(text, player.userID))
//---

Released under the MIT License.