Skip to main content
FA Shop Robbery exposes a client-side API for shop and target integrations. These exports describe the local clerk entity and its current presentation state.
Every export on this page is client-side only. Do not use it for purchases, prices, rewards, or other authoritative gameplay decisions. Validate those actions in the owning resource’s server code.

Resource name

Examples use the default resource name:
If your server uses a different resource folder name, replace fa_shoprobbery with the running resource name in every export call.

GetClerkEntity

Returns the local ped entity for a configured store.
Returns the entity handle (number) or nil when the store is unknown, the clerk is disabled, or the local entity does not exist.

GetClerkState

Returns the last published clerk state for a configured store.
Returns one of idle, surrendering, intimidated, hostile, dead, or disabled, or nil when the store ID is unknown or the state has not been published yet.

CanUseClerkShop

Returns whether the clerk is present, alive, and currently idle.
Returns true only while the local clerk entity exists, is alive, and has the idle state. Use this as a client-side visibility guard for a shop target.

GetClerkData

Returns the current clerk snapshot in one table.
Returns nil when the store ID is unknown.

FindClerkStore

Finds the closest enabled clerk store within a radius. This is useful when another resource starts from its own shop location instead of FA Shop Robbery’s store ID.
Returns the closest enabled store ID or nil when no clerk is within the radius.

Lifecycle events

Subscribe to events and refresh your target instead of caching a ped indefinitely. A killed or reset clerk can be recreated with a new entity handle.
Each event passes a table containing storeId, entity, state, and coords. clerkStateChanged also includes previousState. clerkRemoved includes reason.
When your resource starts after FA Shop Robbery, call GetClerkData once during startup and then subscribe to the lifecycle events for subsequent changes.