Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tweak(conf): added configurable custom url image
  • Loading branch information
renzuzu committed Aug 30, 2021
1 parent 852c172 commit 1aed0a1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
7 changes: 7 additions & 0 deletions client/client.lua
Expand Up @@ -634,6 +634,7 @@ RegisterNUICallback("choosecategory", function(data, cb)
{
brand = v.brand,
category = v.category,
image = v.image,
name = v.name,
brake = v.brake,
handling = v.handling,
Expand Down Expand Up @@ -718,6 +719,10 @@ AddEventHandler('renzu_vehicleshop:receive_vehicles', function(tb,shoptype)
if shoptype == 'boat' or shoptype == 'plane' then
pmult,tmult,handling, brake = 10,8,GetPerformanceStats(vehicleModel).handling * 0.1, GetPerformanceStats(vehicleModel).brakes * 0.1
end
local img = 'https://cfx-nui-renzu_vehicleshop/imgs/uploads/'..value.model..'.jpg'
if Config.CustomImg then
img = value[Config.CustomImgColumn]
end
local VTable = {
brand = GetVehicleClassnamemodel(GetHashKey(value.model)),
name = vehname:upper(),
Expand All @@ -728,6 +733,7 @@ AddEventHandler('renzu_vehicleshop:receive_vehicles', function(tb,shoptype)
torque = math.ceil(GetVehicleModelAcceleration(vehicleModel)*tmult),
model = value.model,
category = value.category,
image = img,
model2 = GetHashKey(value.model),
price = value.price,
name = value.name,
Expand Down Expand Up @@ -772,6 +778,7 @@ function OpenShop(id)
{
brand = v.brand,
category = v.category,
image = v.image,
name = v.name,
brake = v.brake,
handling = v.handling,
Expand Down
12 changes: 7 additions & 5 deletions config.lua
@@ -1,6 +1,6 @@
Config = {}
Config.Locale = "en"
Config.Mysql = 'mysql-async' -- "ghmattisql", "mysql-async"
Config.Mysql = 'ghmattisql' -- "ghmattisql", "mysql-async"
Config.UseRayZone = false -- unrelease script https://github.com/renzuzu/renzu_rayzone
Config.UsePopUI = true -- Create a Thread for checking playercoords and Use POPUI to Trigger Event, set this to false if using rayzone. Popui is originaly built in to RayZone -- DOWNLOAD https://github.com/renzuzu/renzu_popui
Config.Quickpick = true -- if false system will create a garage shell and spawn every vehicle you preview
Expand All @@ -10,6 +10,8 @@ Config.SaveJob = true -- this config is to save the value to owned_vehicles.job
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
Config.CustomImg = false -- if true your Config.CustomImgColumn IMAGE url will be used for each vehicles else, the imgs/uploads/MODEL.jpg
Config.CustomImgColumn = 'imglink' -- db column name

VehicleShop = {
['pdm'] = { -- same with name
Expand All @@ -28,10 +30,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] = {label = 'Suprang Bagal', model = 'jester3', value = 100000, coord = vector4(-47.427722930908,-1101.3747558594,25.714616775513,341.64694213867)},
[2] = {label = 'Suprang Bagal', model = 'elegy', value = 1000000, coord = vector4(-44.736125946045,-1094.1976318359,25.748092651367,158.2547454834)},
[3] = {label = 'Suprang Bagal', model = 'adder', value = 1000000, coord = vector4(-40.32751083374,-1095.6105957031,26.009906768799,158.58676147461)},
[4] = {label = 'Suprang Bagal', model = 'ruston', value = 1000000, coord = vector4(-43.318450927734,-1102.1627197266,25.758722305298,340.29724121094)},
}
},

Expand Down
3 changes: 2 additions & 1 deletion html/script.js
Expand Up @@ -446,9 +446,10 @@ $(document).on('keydown', function(event) {
}
for(i = 0; i < (data.length); i++) {
var modelUper = data[i].model;
var imagecar = data[i].image;
////console.log(modelUper)
inGarageVehicle[i] = data[i]
$(".app_inner").append('<label style="cursor:pointer;"><input false="" id="tab-'+ i +'" onclick="ShowVehicle('+i+')" name="buttons" type="radio"> <label for="tab-'+ i +'"> <div class="app_inner__tab"> <span style="position:absolute;top:4px;left:8px;font-size:8px;color:#b0b1b1;font-weight: 500;">Class: '+ data[i].category +'</span> <span style="position:absolute;top:4px;right:5px;font-weight: 700;font-size:12px;color:#5ab34f;">Price: '+ data[i].price +'</span><h2 style="font-size:11px !important;"> <i class="icon" style="right:100px;"><img style="height:20px;" src="https://cdn.discordapp.com/attachments/709992715303125023/813351303887192084/wheel.png"></i> '+ data[i].name +' </h2> <div class="tab_left"> <i class="big icon"><img class="imageborder" style="height:80px;" onerror="this.src=`https://cdn.discordapp.com/attachments/709992715303125023/813351303887192084/wheel.png`;" src="../imgs/uploads/' + modelUper +'.jpg"></i> </div> <div class="tab_right"> <button class="confirm_out" style="background:green" onclick="BuyVehicle(`'+ data[i].name +'`,`'+ data[i].category +'`,`'+ data[i].price +'`)"> Buy </button> <div class="row" id="confirm"> <button class="confirm_out" style="background:red" onclick="TestDrive(`'+ data[i].name +'`,`'+ data[i].category +'`,`'+ data[i].price +'`,`'+ data[i].model +'`)"> Test Drive </button> </div> </div> </div> </label></input></label>');
$(".app_inner").append('<label style="cursor:pointer;"><input false="" id="tab-'+ i +'" onclick="ShowVehicle('+i+')" name="buttons" type="radio"> <label for="tab-'+ i +'"> <div class="app_inner__tab"> <span style="position:absolute;top:4px;left:8px;font-size:8px;color:#b0b1b1;font-weight: 500;">Class: '+ data[i].category +'</span> <span style="position:absolute;top:4px;right:5px;font-weight: 700;font-size:12px;color:#5ab34f;">Price: '+ data[i].price +'</span><h2 style="font-size:11px !important;"> <i class="icon" style="right:100px;"><img style="height:20px;" src="https://cdn.discordapp.com/attachments/709992715303125023/813351303887192084/wheel.png"></i> '+ data[i].name +' </h2> <div class="tab_left"> <i class="big icon"><img class="imageborder" style="height:80px;" onerror="this.src=`https://cdn.discordapp.com/attachments/709992715303125023/813351303887192084/wheel.png`;" src="' + imagecar + '"></i> </div> <div class="tab_right"> <button class="confirm_out" style="background:green" onclick="BuyVehicle(`'+ data[i].name +'`,`'+ data[i].category +'`,`'+ data[i].price +'`)"> Buy </button> <div class="row" id="confirm"> <button class="confirm_out" style="background:red" onclick="TestDrive(`'+ data[i].name +'`,`'+ data[i].category +'`,`'+ data[i].price +'`,`'+ data[i].model +'`)"> Test Drive </button> </div> </div> </div> </label></input></label>');
}
}
renzu_vehicleshop.Open(VehicleArr)
Expand Down

0 comments on commit 1aed0a1

Please sign in to comment.