Oxygen

OnPlayerLockPickEnded

This hook is triggered when a player finishes a lockpicking attempt, regardless of whether they succeeded or failed.

Definition

public override void OnPlayerLockPickEnded(PlayerBase player, PlayerLockPickData data) {}

Parameters

ParameterTypeDescription
playerPlayerBaseThe instance of the player who performed the lockpicking.
dataPlayerLockPickDataA struct containing detailed information about the lockpick attempt.

PlayerLockPickData Struct

The data parameter provides the following properties:

PropertyTypeDescription
TargetstringThe name or type of the object being picked (e.g., "Door", "Locker").
TargetIdstringUnique identifier for the specific target object.
OwnerSteamIdstringThe SteamID64 of the player who owns the target.
OwnerNamestringThe name of the player who owns the target.
ResultintThe outcome: 1 for success, 0 for failure.
FailCountintHow many times the player failed during this specific session.

Usage Example

public override void OnPlayerLockPickEnded(PlayerBase player, PlayerLockPickData data)
{
    if (data.Result == 1)
    {
        // Logic for successful pick
        Console.WriteLine($"Player {player.Name} successfully picked {data.Target}");
    }
    else
    {
        // Logic for failure
        Console.WriteLine($"Player {player.Name} failed to pick {data.Target}. Total fails: {data.FailCount}");
    }
}

On this page