[Release] [Standalone] Target Tracking

How to add Target in ATM Can someone help me? I don’t understand :sob:

This is an example from my script that I use for bank and atm.

Citizen.CreateThread(function()
local atm = {
-870868698,
-1126237515,
-1364697528,
506770882,
}
exports[“bt-target”]:AddTargetModel(atm, {
options = {
{
event = “banking:atm”,
icon = “fas fa-piggy-bank”,
label = “Bankomat”,
},
},
job = {“all”},
distance = 2.5
})
end)

RegisterNetEvent(“banking:atm”)
AddEventHandler(“banking:atm”, function()
openPlayersBank(‘atm’)
end)

1 Like

Is there a posibility to trigger event with variables? like kamkus_methjob(something)

Here for now

Allows passing on arguments for events. In the example for banking, I pass the model (hash) and also the object to a banking event. Still fleshing it out a bit, but it works for the purpose I need it for (getting specific entity you are interacting with).

To Trigger:

options = {
            {
                event = "banking:atm",
                icon = "fas fa-piggy-bank",
                label = "Use ATM",
                args = true,
            },
            {
                event = "banking:hack",
                icon = "fas fa-piggy-bank",
                label = "Hack ATM",
                args = false,
            },
        },

Decision on whether to just trigger event or pass all data as args

RegisterNUICallback('selectTarget', function(data, cb)
    SetNuiFocus(false, false)
    success = false
    targetActive = false

    if data.event.args then   
        TriggerEvent(data.event.event, data) 
    else
        TriggerEvent(data.event.event)
    end
end)
RegisterNetEvent("banking:atm")
AddEventHandler("banking:atm", function(data)
    TriggerEvent("bank:interact", data) -- Banking Event
end)

Some JS and few other changes in the fork: