Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
feat(client): added marker config (disable popUI)
  • Loading branch information
renzuzu committed Aug 30, 2021
1 parent bbad028 commit 852c172
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 6 deletions.
39 changes: 37 additions & 2 deletions client/client.lua
Expand Up @@ -98,16 +98,47 @@ function PopUI(name,v,event,text,server,shopname)
TriggerEvent('renzu_popui:closeui')
end

function ShowFloatingHelpNotification(msg, coords)
AddTextEntry('FloatingHelpNotification', msg)
SetFloatingHelpTextWorldPosition(1, coords)
SetFloatingHelpTextStyle(1, 1, 2, -1, 3, 0)
BeginTextCommandDisplayHelp('FloatingHelpNotification')
EndTextCommandDisplayHelp(2, false, false, -1)
end

function Marker(vec,msg,event,server)
while #(vec - GetEntityCoords(PlayerPedId())) < 3 and neargarage do
Wait(0)
DrawMarker(36, vec ,0,0,0,0,0,2.0,2.0,2.0,1.0,255, 255, 220,200,0,0,0,1)
ShowFloatingHelpNotification("Press [E] "..msg,vec)
if IsControlJustReleased(0,38) then
if not server then
TriggerEvent(event)
else
TriggerServerEvent(event)
end
Wait(100)
while neargarage and #(vec - GetEntityCoords(PlayerPedId())) < 3 do Wait(100) end
break
end
end
end

CreateThread(function()
if Config.UsePopUI then
while true do
neargarage = false
for k,v in pairs(VehicleShop) do
local vec = vector3(v.shop_x,v.shop_y,v.shop_z)
local inveh = IsPedInAnyVehicle(PlayerPedId())
local dist = #(vec - GetEntityCoords(PlayerPedId()))
if dist < v.Dist and not inveh then
neargarage = true
PopUI(v.title or v.name,vec,"vehicleshop")
if Config.Marker then
Marker(vec,v.title,'vehicleshop')
else
PopUI(v.title or v.name,vec,"vehicleshop")
end
end
end

Expand All @@ -120,7 +151,11 @@ CreateThread(function()
DrawMarker(1, vec ,0,0,0,0,0,2.0,2.0,2.0,1.0,255, 102, 0,200,0,0,0,1)
if dist < v.Dist and inveh then
neargarage = true
PopUI(v.title or v.name,vec,"renzu_vehicleshop:sellvehicle",Config.RefundPercent,true)
if Config.Marker then
Marker(vec,"Sell Vehicle",'renzu_vehicleshop:sellvehicle',true)
else
PopUI(v.title or v.name,vec,"renzu_vehicleshop:sellvehicle",Config.RefundPercent,true)
end
break
end
Wait(0)
Expand Down
10 changes: 6 additions & 4 deletions config.lua
Expand Up @@ -9,6 +9,8 @@ Config.PlateSpace = true -- enable / disable plate spaces (compatibility with es
Config.SaveJob = true -- this config is to save the value to owned_vehicles.job column
Config.Licensed = false -- Enable Driver Licensed Checker
Config.DisplayCars = true -- enable display of cars
Config.Marker = false -- use draw marker and Iscontrollpress native , popui will not work if this is true

VehicleShop = {
['pdm'] = { -- same with name
name = "pdm", --LEGION
Expand All @@ -26,10 +28,10 @@ VehicleShop = {
spawn_z = 25.749485015869,
heading = 340.23065185547, -- Vehicle spawn location,
displaycars = {
[1] = { model = 'jester3', value = 100000, coord = vector4(-47.427722930908,-1101.3747558594,25.714616775513,341.64694213867)},
[2] = { model = 'elegy', value = 1000000, coord = vector4(-44.736125946045,-1094.1976318359,25.748092651367,158.2547454834)},
[3] = { model = 'adder', value = 1000000, coord = vector4(-40.32751083374,-1095.6105957031,26.009906768799,158.58676147461)},
[4] = { model = 'ruston', value = 1000000, coord = vector4(-43.318450927734,-1102.1627197266,25.758722305298,340.29724121094)},
[1] = {model = 'jester3', value = 100000, coord = vector4(-47.427722930908,-1101.3747558594,25.714616775513,341.64694213867)},
[2] = {model = 'elegy', value = 1000000, coord = vector4(-44.736125946045,-1094.1976318359,25.748092651367,158.2547454834)},
[3] = {model = 'adder', value = 1000000, coord = vector4(-40.32751083374,-1095.6105957031,26.009906768799,158.58676147461)},
[4] = {model = 'ruston', value = 1000000, coord = vector4(-43.318450927734,-1102.1627197266,25.758722305298,340.29724121094)},
}
},

Expand Down

0 comments on commit 852c172

Please sign in to comment.