lib.locale() local config = { clothing = { ped = false, headBlend = false, faceFeatures = false, headOverlays = false, components = true, props = true, tattoos = false, text = '[E] - Kleding' }, barber = { ped = false, headBlend = false, faceFeatures = false, headOverlays = true, components = false, props = false, tattoos = false, text = '[E] - Kapper' }, tattoos = { ped = false, headBlend = false, faceFeatures = false, headOverlays = false, components = false, props = false, tattoos = true, text = '[E] - Tattoos' } } local shops = { clothing = { vec(72.3, -1399.1, 28.4), vec(-708.71, -152.13, 36.4), vec(-165.15, -302.49, 38.6), vec(428.7, -800.1, 28.5), vec(-829.4, -1073.7, 10.3), vec(-1449.16, -238.35, 48.8), vec(11.6, 6514.2, 30.9), vec(122.98, -222.27, 53.5), vec(1696.3, 4829.3, 41.1), vec(618.1, 2759.6, 41.1), vec(1190.6, 2713.4, 37.2), vec(-1193.4, -772.3, 16.3), vec(-3172.5, 1048.1, 19.9), vec(-1108.4, 2708.9, 18.1), }, barber = { vec(-814.3, -183.8, 36.6), vec(136.8, -1708.4, 28.3), vec(-1282.6, -1116.8, 6.0), vec(1931.5, 3729.7, 31.8), vec(1212.8, -472.9, 65.2), vec(-34.31, -154.99, 55.8), vec(-278.1, 6228.5, 30.7), }, tattoos = { vec(1322.6, -1651.9, 51.2), vec(-1153.6, -1425.6, 4.9), vec(322.1, 180.4, 103.5), vec(-3170.0, 1075.0, 20.8), vec(1864.6, 3747.7, 33.0), vec(-293.7, 6200.0, 31.4) } } local function createBlip(name, sprite, colour, scale, location) if not location.w then local blip = AddBlipForCoord(location.x, location.y) SetBlipSprite(blip, sprite) SetBlipDisplay(blip, 4) SetBlipScale(blip, scale) SetBlipColour(blip, colour) SetBlipAsShortRange(blip, true) BeginTextCommandSetBlipName('STRING') AddTextComponentSubstringPlayerName(name) EndTextCommandSetBlipName(blip) end end local function openShop(shopType) exports['fivem-appearance']:startPlayerCustomization(function(appearance) if (appearance) then if ESX then TriggerServerEvent('esx_skin:save', appearance) else TriggerServerEvent('ox_appearance:save', appearance) end end end, config[shopType]) end exports("OpenShop", openShop) local function SetJobOutfit(props, components) local ped = PlayerPedId() ESX.TriggerServerCallback('ox_appearance:getPlayerSkin', function(data) local outfitData = data if props and next(props) then for k,v in pairs(props) do outfitData.props[k] = props[k] end end if components and next(components) then for k,v in pairs(components) do outfitData.components[k] = components[k] end end --[[outfitData.props = props outfitData.components = components--]] exports['fivem-appearance']:setPedAppearance(ped, outfitData) end) end exports('SetJobOutfit', SetJobOutfit) local function SetCivilianOutfit() local ped = PlayerPedId() ESX.TriggerServerCallback('ox_appearance:getPlayerSkin', function(data) exports['fivem-appearance']:setPedAppearance(ped, data) end) end exports('SetCivilianOutfit', SetCivilianOutfit) -- Create Blips if GetConvarInt("ox_appearance:disable_blips", 0) == 0 then for i = 1, #shops.clothing do createBlip(locale('clothing_blip'), 73, 0, 0.7, shops.clothing[i]) end for i = 1, #shops.barber do createBlip(locale('barber_blip'), 71, 0, 0.7, shops.barber[i]) end for i = 1, #shops.tattoos do createBlip(locale('tattoo_blip'), 75, 0, 0.7, shops.tattoos[i]) end end Citizen.CreateThread(function() while true do local sleep = 750 local coords = GetEntityCoords(PlayerPedId()) local closestShop for name, data in pairs(shops) do for i=1, #data do local distance = #(data[i].xyz - coords) if distance < 25 then closestShop = distance currentShop = data[i] shopType = name end end end if closestShop and closestShop < 10.0 then sleep = 0 if config[shopType] then ESX.Game.Utils.DrawMarker(currentShop.xyz, 2, 0.2, 23, 191, 68) if closestShop < 5.0 then exports['frp-interaction']:Interaction('success', config[shopType]['text'], currentShop.xyz, 7.5, GetCurrentResourceName()) if IsControlJustReleased(0, 38) then exports['es_extended']:staticBypass(true) exports['fivem-appearance']:startPlayerCustomization(function(appearance) exports['es_extended']:staticBypass(false) if (appearance) then local price, reason = shopType == 'clothing' and 500 or 1000, shopType == 'clothing' and 'Kleding kopen' or 'Tattoo' exports['frp-payments']:startPayment({ price = price, reason = reason, }, function(success) if success then if ESX then TriggerServerEvent('esx_skin:save', appearance) else TriggerServerEvent('ox_appearance:save', appearance) end else ESX.ShowNotification("error", 'Aankoop gecanceld!') end end) end end, config[shopType]) end end end end Citizen.Wait(sleep) end end)