server.lua
client.lua
Lockpick in my-resource is my-resource:Lockpick.
Options
Set
kinds or models for entity actions, or coords for places. Not both.
The handler
handler(source, context) returns one value, passed to the option’s onResult. context holds:
action,kind,coords(read on the server).entity,netId,modelfor entities.player, the server id, when the target is another player.
internal_error and logs the error on the server.
What the server checks
In order:- The action exists.
- The entity exists, by network id, and matches
kindsandmodels. A mismatch flagsInvalidPayloadin ug-core’s Guard. - The player’s ped is within
distance + actionMargin. OtherwiseOutOfRangeis flagged. - The player is alive, unless
allowDowned. - The conditions, from ug-core jobs, gangs and inventory.
- The cooldown.
- For
hold: aBeginfor the same action and entity at leastholdms before. Skipping it flagsInvalidPayload.
RemoveAction(name) removes an action. Actions are removed when their resource stops.