OnVehicleLockRequest
Usage
- Return a non-null value to override default behavior
Example Autogenerated
csharp
private object OnVehicleLockRequest( ModularCarGarage instance, BasePlayer player, string text )
{
Puts( "OnVehicleLockRequest works!" );
return null;
}Location
- ModularCarGarage::RPC_RequestAddLock(BaseEntity.RPCMessage msg)
csharp
//---
if (player == null)
{
return;
}
string text = msg.read.String();
if (Interface.CallHook("OnVehicleLockRequest", this, player, text) == null)
{
ItemAmount itemAmount = lockResourceCost;
if ((float)player.inventory.GetAmount(itemAmount.itemDef.itemid) >= itemAmount.amount && carOccupant.CarLock.TryAddALock(text, player.userID))
{
player.inventory.Take(null, itemAmount.itemDef.itemid, Mathf.CeilToInt(itemAmount.amount));
//---