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
PayContract(source, amount)
PayContract(source, amount)
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.HasBlacklistedJob(source)
HasBlacklistedJob(source)
Returns whether the player has a job from
Config.BlacklistedJobs. Players with a blacklisted job can’t take contracts.Hooks
SuccessfulStep(source, step)
SuccessfulStep(source, step)
Called whenever a player completes a step.
step is "Proof" (photo taken, once per target) or "Contract" (contract paid out).FailedStep(source, step)
FailedStep(source, step)
Called whenever a player fails a step. Use this to remove XP, items, or apply penalties.
InitialCheck(src, approach)
InitialCheck(src, approach)
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.ContractCompleteHook(source, tier, payout, contract)
ContractCompleteHook(source, tier, payout, contract)
Called after a contract is paid out.
tier is the Config.Tiers key, and contract contains the weapon request and one entry per target:ContractFailedHook(source, tier, reason)
ContractFailedHook(source, tier, reason)
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".