Skip to main content
Most of the core logic in this resource is handled by the bridge. The open source files are provided so you can customize the handler dialog, the payout, add hooks for custom systems, and extend the script without touching escrow.

opensource/client/client.lua

This file handles zone creation, drawtext, evidence, and the handler dialog.

Handler Dialog

ShowDialog(data) opens the handler conversation with projectx-ui when Config.Dialog = "projectx". AlertDialog(data) is used for Config.Dialog = "ox", or as a fallback when projectx-ui isn’t started. You can replace either function to use your own dialog UI.

opensource/server/server.lua

This file handles dispatch, item/money functions, the payout, logging, the admin command, and exposes several hooks you can use to run custom logic at specific points in a contract.

Dispatch

Dispatch(source, override) sends the homicide alert. override can contain Title, Message, Code, and Coords, used instead of Config.Dispatch and the player’s position.

Payout

Pays the contract according to Config.Payout. Must return false if the player couldn’t be paid, in which case the handler asks them to come back.
Returns whether the player has a job from Config.BlacklistedJobs. Players with a blacklisted job can’t take contracts.

Hooks

Called whenever a player completes a step. step is "Proof" (photo taken, once per target) or "Contract" (contract paid out).
Called whenever a player fails a step. Use this to remove XP, items, or apply penalties.
Called before a contract is offered. approach is "Handler". Return false to block it, for example for a group check, a tablet / phone integration, or a required item.
Called after a contract is paid out. tier is the Config.Tiers key, and contract contains the weapon request and one entry per target:
Called when a contract fails. source can be nil if the owner is offline. reason is a locale key: "target_escaped", "someone_else", "contract_expired", "return_expired", "too_many_innocents", "target_vanished", "spawn_failed", or "contract_cancelled".