diff --git a/client/cl_menus.lua b/client/cl_menus.lua
index 03012af..556c58f 100644
--- a/client/cl_menus.lua
+++ b/client/cl_menus.lua
@@ -3,7 +3,7 @@ local function GenerateOptions()
for i = 1, #Config.games, 1 do
options[#options + 1] = {
label = Config.games[i].label,
- icon = Config.games[i].icon or 'fa-gamepad', -- WIP: Verplaatsen naar config voor fa-gamepad
+ icon = Config.games[i].icon or 'fa-gamepad',
}
end
return options
@@ -14,7 +14,7 @@ local function GenerateHacks()
for i = 1, #Config.hacks, 1 do
options[#options + 1] = {
label = Config.hacks[i].label,
- icon = Config.hacks[i].icon or 'fa-gamepad', -- WIP: Verplaatsen naar config voor fa-gamepad
+ icon = Config.hacks[i].icon or 'fa-gamepad',
}
end
return options
diff --git a/client/cl_target.lua b/client/cl_target.lua
index b2bf5c9..bb18033 100644
--- a/client/cl_target.lua
+++ b/client/cl_target.lua
@@ -1,15 +1,9 @@
-local models = {1876055757, -1501557515, -1502319666, 815879628, -1991361770, 1301167921, -538006270, 2303605526, 4185618299, 3756961026, 2793409781, 398786301, 568464183, 3067040863, 3171514707, 3899793496, 974001996, 4206216415, 1457191833, 3054877820, 4129005630, 3963576280, 3325005861, 543442061, 372224036, -1273554963} -- WIP: Verplaatsen naar config?
+local models = {2303605526, 3756961026, 1301167921, 2793409781, 1876055757, 2792647630, 398786301, 3067040863, 568464183, 3171514707, 3899793496, 974001996, 4206216415, 1457191833, 3054877820, 815879628, 4129005630, 3325005861, 900099857, 543442061, 372224036, 970154536}
local function requireToken()
if not lib.callback.await('qb-arcade:server:hasToken') then
-
- lib.notify({
- title = Lang:t('error.no_token_title'),
- description = Lang:t('error.no_token'),
- type = 'error',
- })
-
+ QBCore.Functions.Notify(Lang:t('error.no_token'), 'error')
return false
end
diff --git a/client/cl_tokens.lua b/client/cl_tokens.lua
index 81e2328..91ab656 100644
--- a/client/cl_tokens.lua
+++ b/client/cl_tokens.lua
@@ -1,3 +1,5 @@
+local pedEntities = {}
+
local function Nearby()
if IsControlJustPressed(0, 38) then
lib.showContext('arcade_purchase_token')
@@ -25,4 +27,47 @@ CreateThread(function()
nearby = Nearby
})
end
+end)
+
+CreateThread(function()
+ for i, v in ipairs(Config.shops) do
+ lib.points.new({
+ coords = v.coords,
+ distance = 25,
+
+ onEnter = function()
+ -- spawn npc here
+ local model = joaat(v.model)
+ lib.requestModel(model)
+ local ped = CreatePed(4, model, v.coords.x, v.coords.y, v.coords.z, false, false, false)
+ SetEntityHeading(ped, v.coords.w)
+ FreezeEntityPosition(ped, true)
+ SetEntityInvincible(ped, true)
+ SetBlockingOfNonTemporaryEvents(ped, true)
+ SetPedDiesWhenInjured(ped, false)
+ SetPedCanPlayAmbientAnims(ped, true)
+
+ if v.scenario then
+ TaskStartScenarioInPlace(ped, v.scenario, 0, true)
+ end
+ pedEntities[i] = ped
+
+ exports['qb-target']:AddTargetEntity(ped, {
+ options = {
+ {
+ label = Lang:t('interactions.enter_token_shop'),
+ icon = v.icon,
+ action = function()
+ lib.showContext('arcade_purchase_token')
+ end
+ }
+ }
+ })
+ end,
+
+ onExit = function()
+ DeleteEntity(pedEntities[i])
+ end,
+ })
+ end
end)
\ No newline at end of file
diff --git a/html/index.html b/html/index.html
index 1d0454d..2485e97 100644
--- a/html/index.html
+++ b/html/index.html
@@ -14,7 +14,7 @@
- Arcade machine uitzetten
+ Arcade uitzetten