Hello, I will explain np-target and bt-target integration as far as I know.
First of all, you go to the target file you are using and open the client.lua.
You come to the bottom line of code and paste the following code in an empty place
After pasting the code, you open the client.lua of the script you want to integrate into the target. After you open it, you find the script's interaction code.
E.g ; I want to integrate okokBanking. Here is okokBanking's interaction code,
After you find the interaction code of the script, you create RegisterNetEvent and write an event name you want.
E.g ;
After setting the interaction at the bottom of the client.lua of the script you want, you go back to the np-target client.lua and paste the following code into Citizen.CreateThread.
E.g ;
Here, -870868698 is the code of the atm props code, that is, the code of the object with which np and bt target will interact.
View attachment 4105
event = "atmac", an event name you specify, the event name here is above. np or bt target's client.lua should be like this.
E.g ;
There is more
After Citizen.CreateThread is as above, you create the following code after the Citizen.CreateThread end
E.g ;
Here, since I wrote RegisterNetEvent('atmac', function() "atmac" above as event = "atmac", I wrote "atmac" in it, so it could be like this.
The place that says blabla will be the names you want, but do not forget to write the same name in both places. In short, the client.lua of np or bt target will be as follows.
The client.lua of the script you want will be as follows.
If I have a wrong explanation, I would appreciate it if you warn me in the comments. If you encounter such a problem with the process, please also comment. I'm sorry if I made a typo.
credit: uziii
First of all, you go to the target file you are using and open the client.lua.
You come to the bottom line of code and paste the following code in an empty place
Code:
Citizen.CreateThread(function()
end)
After pasting the code, you open the client.lua of the script you want to integrate into the target. After you open it, you find the script's interaction code.
E.g ; I want to integrate okokBanking. Here is okokBanking's interaction code,
Code:
local dict = 'anim@amb@prop_human_atm@interior@male@enter'
local anim = 'enter'
local ped = GetPlayerPed(-1)
ESX.TriggerServerCallback("okokBanking:GetPIN", function(pin)
if pin then
if not isBankOpened then
isBankOpened = true
RequestAnimDict(dict)
while not HasAnimDictLoaded(dict) do
Citizen.Wait(7)
end
TaskPlayAnim(ped, dict, anim, 8.0, 8.0, -1, 0, 0, 0, 0, 0)
Citizen.Wait(Config.AnimTime)
ClearPedTasks(ped)
SetNuiFocus(true, true)
SendNUIMessage({
action = 'atm',
pin = pin,
})
end
else
exports['okokNotify']:Alert("BANK", "PIN Kodu ayarlamak için bankaya gidiniz", 5000, 'info')
end
end)
end)
After you find the interaction code of the script, you create RegisterNetEvent and write an event name you want.
E.g ;
Code:
RegisterNetEvent("okok:atmac")
AddEventHandler("okok:atmac", function()
local dict = 'anim@amb@prop_human_atm@interior@male@enter'
local anim = 'enter'
local ped = GetPlayerPed(-1)
ESX.TriggerServerCallback("okokBanking:GetPIN", function(pin)
if pin then
if not isBankOpened then
isBankOpened = true
RequestAnimDict(dict)
while not HasAnimDictLoaded(dict) do
Citizen.Wait(7)
end
TaskPlayAnim(ped, dict, anim, 8.0, 8.0, -1, 0, 0, 0, 0, 0)
Citizen.Wait(Config.AnimTime)
ClearPedTasks(ped)
SetNuiFocus(true, true)
SendNUIMessage({
action = 'atm',
pin = pin,
})
end
else
exports['okokNotify']:Alert("BANK", "PIN Kodu ayarlamak için bankaya gidiniz", 5000, 'info')
end
end)
end)
After setting the interaction at the bottom of the client.lua of the script you want, you go back to the np-target client.lua and paste the following code into Citizen.CreateThread.
E.g ;
Code:
local bankamatik1 = {
-870868698,
}
AddTargetModel(bankamatik1, {
options = {
{
event = "atmac",
icon = "fas fa-credit-card",
label = "Banka Hesabına Eriş",
},
},
distance = 2.5
})
Here, -870868698 is the code of the atm props code, that is, the code of the object with which np and bt target will interact.
View attachment 4105
event = "atmac", an event name you specify, the event name here is above. np or bt target's client.lua should be like this.
E.g ;
Code:
Citizen.CreateThread(function()
local bankamatik1 = {
-870868698,
}
AddTargetModel(bankamatik1, {
options = {
{
event = "atmac",
icon = "fas fa-credit-card",
label = "Banka Hesabına Eriş",
},
},
distance = 2.5
})
end)
There is more
After Citizen.CreateThread is as above, you create the following code after the Citizen.CreateThread end
E.g ;
Code:
RegisterNetEvent('atmac', function()
TriggerEvent('okok:atmac')
end)
Here, since I wrote RegisterNetEvent('atmac', function() "atmac" above as event = "atmac", I wrote "atmac" in it, so it could be like this.
Code:
RegisterNetEvent('blabla', function()
event = "blabla",
The place that says blabla will be the names you want, but do not forget to write the same name in both places. In short, the client.lua of np or bt target will be as follows.
Code:
Citizen.CreateThread(function()
local bankamatik1 = {
-870868698,
}
AddTargetModel(bankamatik1, {
options = {
{
event = "atmac",
icon = "fas fa-credit-card",
label = "Banka Hesabına Eriş",
},
},
distance = 2.5
})
end)
RegisterNetEvent('atmac', function()
TriggerEvent('okok:atmac')
end)
The client.lua of the script you want will be as follows.
Code:
RegisterNetEvent("okok:atmac")
AddEventHandler("okok:atmac", function()
scriptin etkileşime girdiği kod burada olacak
end)
If I have a wrong explanation, I would appreciate it if you warn me in the comments. If you encounter such a problem with the process, please also comment. I'm sorry if I made a typo.
credit: uziii