Documentation navigation

Integrations

Outside vRP, the manifest changes too#

Rewriting only the bridge is not enough. fxmanifest.lua loads vRP files before any of our code runs, and the resource refuses to start without it. In sf_crafting these are the lines:

  • dependencies { "vrp", "oxmysql", "PolyZone" }
  • "@vrp/config/Item.lua", "@vrp/config/Vehicle.lua", "@vrp/config/Global.lua" and "@vrp/config/Drops.lua" in shared_scripts
  • "@vrp/config/Native.lua" and "@vrp/lib/Utils.lua" in client_scripts
  • "@vrp/lib/Utils.lua" in server_scripts

Replace "vrp" in dependencies with your framework (or drop the line) and swap the @vrp/... includes for its equivalents. Only after that does the bridge adaptation take effect.

bridge/server.lua#

FunctionWhat it must return
Passport(source)unique character id
Source(passport)online source, or nil
HasPermission(passport, perm)bool
HasGroup(passport, group)bool — farm bonus, /craftconfig, /sfdiagnostico and the police alert
Grupos(passport){ [group] = rank } — this is what decides which faction's vault is the player's
PlayerName(passport)display name, for rankings and orders
MembrosOnline(group)online sources in the group — who receives the route tip-off
ItemAmount(passport, item)amount, real key
RemoveItem / GiveItem / CanCarryitem movement and backpack limits
ItemName(item)display name
ItemExiste(item)bool — used only by /sfdiagnostico
PermissaoExiste(perm)bool or nil ("don't know") — used only by /sfdiagnostico
Pay(passport, amount)charges atomically (upgrades, orders)
Reward(passport, amount)pays the player (routes, orders)
InIsolatedWorld(source)is the player outside the city?
PlayerCoords(source)vector3
BindInterface(table)publishes the functions to the client
Notify / NotifySourceon-screen notification

Grupos returning an empty table is not an error: it means "no faction", and the bench refuses the organization vault instead of picking one on its own.

Reward is the counterpart of Pay and exists separately because paying and charging hit different accounts in most bases.

bridge/client.lua#

FunctionWhat it does
Bridge.Server.*client → server channel (Tunnel on vRP)
Notify / Progressnotification and progress bar
AddZone / RemoveZoneinteraction zone (target)
DrawInteractPrompt / IsInteractPressedthe "press E" prompt on the route
CreateBlip / RemoveBliproute blip
CreateAlertBlip(coord, title)approximate tip-off marker, for the police

RemoveZone must work: it is what erases the old zone when a bench moves in /craftconfig. Without it, the old spot keeps opening the bench.

Each function has the ESX / QBCore / ox_lib equivalent commented right above it, in the file itself.

Your own dispatch#

If your base has an incident system, fill Config.Rotas.Policia.Evento with its event. It receives (title, message, x, y, z) and replaces the default notify + blip. The coordinate already arrives with noise — do not increase the precision: the imprecision is what keeps the route playable.

Exports and events#

SF Crafting exposes no public exports. The sf_crafting:* events are internal to the queue, warehouse, routes, orders and NUI, and must not be triggered from outside.