Target scripts
Most FiveM scripts add their interactions through ox_target, qb-target or qtarget. SL-Interact takes the place of all three: it answers their calls and shows those interactions with its own points and label. You don’t change a line of those scripts, and it also works with scripts protected by escrow.
How to set it up
Section titled “How to set it up”- Remove
ox_target,qb-targetorqtargetfrom yourserver.cfg(or move them to a[disabled]folder). - Start
sl_interactbefore every script that uses them. - Restart the whole server.
That’s all. Scripts that declare dependency 'ox_target' or dependency 'qb-target' start normally: SL-Interact provides those names.
What it translates
Section titled “What it translates”| ox_target | qb-target / qtarget | |
|---|---|---|
| Entities and networked entities | addEntity, addLocalEntity |
AddTargetEntity, AddEntityZone |
| Models | addModel |
AddTargetModel |
| Every ped, vehicle, object, player | addGlobalPed, addGlobalVehicle, addGlobalObject, addGlobalPlayer |
AddGlobalPed, AddGlobalVehicle, AddGlobalObject, AddGlobalPlayer, AddGlobalType |
| Vehicle bones | bones in the options |
AddTargetBone |
| Sphere and box zones | addSphereZone, addBoxZone |
AddCircleZone, AddBoxZone |
| Removing | remove*, removeZone |
Remove*, RemoveZone |
| Pausing | disableTargeting |
AllowTargeting, DisableTarget, EnableTarget |
| Peds | SpawnPed, DeletePeds, RemoveSpawnedPed |
Options keep working as written: label, icon, distance, canInteract, onSelect, action, event, serverEvent, command, groups / job / gang, items / item and their arguments. For ox_target also offset, offsetSize and absoluteOffset (each one shows in its place on the vehicle), and canInteract and onSelect get the exact point you aim at, the distance and the bone, like in ox_target.
What several scripts add to the same thing (a car, a ped, an object) shows together in one label, as in the originals.
The icons of those scripts (Font Awesome names) are shown with the closest icon of SL-Interact.
What changes for the player
Section titled “What changes for the player”- The label of SL-Interact replaces the eye and the list of the original.
- Global options (every vehicle, every player…) follow
Config.Reveal.globals, which is Alt by default, like the original. - Everything else follows
Config.Reveal.default(shows when close) unless you choose otherwise in the interactions panel. - Every one of those interactions appears in the interactions panel under its script, and can be renamed, changed or turned off from there.
Limits
Section titled “Limits”| Feature | What happens |
|---|---|
Polygon zones (addPolyZone, AddPolyZone) |
Shown as a point in the center of the polygon. A warning is printed once in F8 |
AddComboZone |
Not supported. A warning is printed once in F8 |
addGlobalOption (ox_target: an option on everything) |
Not supported. A warning is printed once in F8 |
Get*Data / Update*Data (qb-target) |
Get* return an empty table; Update* do nothing and warn once |
None of these stop the calling script: it keeps running, only that interaction is approximated or missing.
Restarting
Section titled “Restarting”If you restart only SL-Interact with the server running, the scripts that used the bridge don’t add their interactions again. SL-Interact prints a warning in the console when this happens. Restart the whole server, or restart those scripts too.