Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Giana committed Jan 27, 2023
1 parent 19ac863 commit 922b6ed
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 35 deletions.
14 changes: 7 additions & 7 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function DrawText3Ds(x, y, z, text)
SetTextFont(4)
SetTextProportional(1)
SetTextColour(255, 255, 255, 215)
SetTextEntry("STRING")
SetTextEntry('STRING')
SetTextCentre(true)
AddTextComponentString(text)
SetDrawOrigin(x, y, z, 0)
Expand All @@ -27,7 +27,7 @@ local function configureBlip(location)
SetBlipScale(RentalBlip, 0.6)
SetBlipDisplay(RentalBlip, 4)
SetBlipAsShortRange(RentalBlip, true)
BeginTextCommandSetBlipName("STRING")
BeginTextCommandSetBlipName('STRING')
AddTextComponentSubstringPlayerName(Config.Label)
EndTextCommandSetBlipName(RentalBlip)
end
Expand Down Expand Up @@ -72,11 +72,11 @@ local function createVehicleDisplayZones()
vector3(v.rental_coords.x, v.rental_coords.y, v.rental_coords.z),
3,
3, {
name = "box_zone",
name = 'box_zone',
debugPoly = false,
})
end
local combo = ComboZone:Create(Zones, { name = "vehCombo", debugPoly = false })
local combo = ComboZone:Create(Zones, { name = 'vehCombo', debugPoly = false })
combo:onPlayerInOut(function(isPointInside)
if isPointInside then
setClosestDisplay()
Expand Down Expand Up @@ -111,7 +111,7 @@ RegisterNetEvent('qb-bikerental:client:openBikeMenu', function()
if v.available then
bikeMenu[#bikeMenu + 1] = {
header = v.label,
txt = Lang:t('menu.to_rent', {cost = v.rental_cost}),
txt = Lang:t('menu.to_rent', { cost = v.rental_cost }),
params = {
isServer = true,
event = 'qb-bikerental:server:swapVehicle',
Expand Down Expand Up @@ -169,7 +169,7 @@ RegisterNetEvent('qb-bikerental:client:openBikeRentalConfirmationMenu', function
},
{
header = bike.label,
txt = Lang:t('menu.to_rent', {cost = bike.rental_cost})
txt = Lang:t('menu.to_rent', { cost = bike.rental_cost })
},
{
header = Lang:t('menu.no_back'),
Expand Down Expand Up @@ -204,7 +204,7 @@ RegisterNetEvent('qb-bikerental:client:RentBike', function(data)
SetEntityCoords(ent, x, y, z)
TaskWarpPedIntoVehicle(PlayerPedId(), ent, -1)
SetEntityAsMissionEntity(ent, true, true)
TriggerEvent("vehiclekeys:client:SetOwner", GetVehicleNumberPlateText(ent))
TriggerEvent('vehiclekeys:client:SetOwner', GetVehicleNumberPlateText(ent))
end)
else
QBCore.Functions.Notify(Lang:t('error.not_enough_money'))
Expand Down
56 changes: 28 additions & 28 deletions config.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Config = {}

Config.Label = "Bike Rental" -- Label for locations on map
Config.Label = 'Bike Rental' -- Label for locations on map

Config.WalkUpRentalMenu = false -- True == Walk up to display to open rental menu, False == Must manually press key at display to open rental menu

Expand All @@ -21,121 +21,121 @@ Config.WalkUpRentalMenu = false -- True == Walk up to display to open rental
]]
Config.RentalLocations = {
[1] = {
label = "Fantastic Plaza",
label = 'Fantastic Plaza',
rental_coords = vector3(292.65, -1072.83, 28.41), spawn_coords = vector4(294.57, -1075.61, 29.41, 181.37),
default_veh = 'bmx', chosen_veh = 'bmx',
active = true
},
[2] = {
label = "Integrity Way",
label = 'Integrity Way',
rental_coords = vector3(256.53, -634.12, 39.78), spawn_coords = vector4(260.08, -631.43, 41.11, 334.13),
default_veh = 'cruiser', chosen_veh = 'cruiser',
active = true
},
[3] = {
label = "Morningwood Blvd",
label = 'Morningwood Blvd',
rental_coords = vector3(-1281.39, -425.83, 33.66), spawn_coords = vector4(-1282.16, -429.49, 34.79, 211.71),
default_veh = 'fixter', chosen_veh = 'fixter',
active = true
},
[4] = {
label = "South Rockford Drive",
label = 'South Rockford Drive',
rental_coords = vector3(-675.91, -1104.71, 13.53), spawn_coords = vector4(-672.75, -1099.81, 14.6, 335.77),
default_veh = 'scorcher', chosen_veh = 'scorcher',
active = true
},
[5] = {
label = "Tinsel Towers",
label = 'Tinsel Towers',
rental_coords = vector3(-614.74, 31.94, 42.53), spawn_coords = vector4(-615.69, 22.92, 41.61, 266.41),
default_veh = 'tribike', chosen_veh = 'tribike',
active = true
},
[6] = {
label = "Airport",
label = 'Airport',
rental_coords = vector3(-770.03, -2056.51, 8.02), spawn_coords = vector4(-773.72, -2053.14, 9.02, 46.45),
default_veh = 'tribike2', chosen_veh = 'tribike2',
active = true
},
[7] = {
label = "Maze Bank Arena",
label = 'Maze Bank Arena',
rental_coords = vector3(-226.28, -1877.15, 27.77), spawn_coords = vector4(-221.17, -1878.5, 28.64, 242.66),
default_veh = 'tribike3', chosen_veh = 'tribike3',
active = true
},
[8] = {
label = "Pleasure Pier",
label = 'Pleasure Pier',
rental_coords = vector3(-1574.49, -876.66, 9.14), spawn_coords = vector4(-1570.91, -872.99, 10.13, 316.49),
default_veh = 'bmx', chosen_veh = 'bmx',
active = true
},
[9] = {
label = "Vinewood Bowl",
label = 'Vinewood Bowl',
rental_coords = vector3(733.64, 659.77, 128.05), spawn_coords = vector4(736.58, 659.88, 129.05, 253.7),
default_veh = 'cruiser', chosen_veh = 'cruiser',
active = true
},
[10] = {
label = "Harmony",
label = 'Harmony',
rental_coords = vector3(611.49, 2744.88, 40.97), spawn_coords = vector4(606.83, 2743.2, 42.0, 91.63),
default_veh = 'fixter', chosen_veh = 'fixter',
active = true
},
[11] = {
label = "Grapeseed",
label = 'Grapeseed',
rental_coords = vector3(1683.74, 4828.33, 41.02), spawn_coords = vector4(1682.03, 4824.93, 42.01, 184.02),
default_veh = 'scorcher', chosen_veh = 'scorcher',
active = true
},
[12] = {
label = "El Gordo Drive",
label = 'El Gordo Drive',
rental_coords = vector3(3331.06, 5160.21, 17.25), spawn_coords = vector4(3329.61, 5154.95, 18.3, 137.56),
default_veh = 'tribike', chosen_veh = 'tribike',
active = true
},
[13] = {
label = "Paleto Bay",
label = 'Paleto Bay',
rental_coords = vector3(-12.6, 6507.58, 30.53), spawn_coords = vector4(-14.62, 6504.74, 31.54, 136.32),
default_veh = 'tribike2', chosen_veh = 'tribike2',
active = true
},
[14] = {
label = "Raton Canyon Trails",
label = 'Raton Canyon Trails',
rental_coords = vector3(-1491.81, 4979.68, 62.38), spawn_coords = vector4(-1494.91, 4976.02, 63.53, 179.65),
default_veh = 'tribike3', chosen_veh = 'tribike3',
active = true
},
[15] = {
label = "Mount Chiliad",
label = 'Mount Chiliad',
rental_coords = vector3(509.83, 5530.33, 775.82), spawn_coords = vector4(496.07, 5532.88, 778.36, 130.45),
default_veh = 'bmx', chosen_veh = 'bmx',
active = true
},
[16] = {
label = "Braddock Farm",
label = 'Braddock Farm',
rental_coords = vector3(2501.2, 5114.1, 45.28), spawn_coords = vector4(2507.3, 5116.1, 46.4, 281.74),
default_veh = 'cruiser', chosen_veh = 'cruiser',
active = true
},
[17] = {
label = "Chumash",
label = 'Chumash',
rental_coords = vector3(-3127.9, 1121.12, 19.66), spawn_coords = vector4(-3126.75, 1125.24, 20.66, 353.7),
default_veh = 'fixter', chosen_veh = 'fixter',
active = true
},
[18] = {
label = "Kortz Center",
label = 'Kortz Center',
rental_coords = vector3(-2318.9, 452.0, 173.6), spawn_coords = vector4(-2319.65, 446.04, 174.6, 174.28),
default_veh = 'scorcher', chosen_veh = 'scorcher',
active = true
},
[19] = {
label = "Tataviam Mountains",
label = 'Tataviam Mountains',
rental_coords = vector3(1211.96, -278.55, 68.08), spawn_coords = vector4(1208.26, -274.81, 69.08, 35.14),
default_veh = 'tribike', chosen_veh = 'tribike',
active = true
},
[20] = {
label = "Galileo Observatory",
label = 'Galileo Observatory',
rental_coords = vector3(-421.05, 1221.16, 324.77), spawn_coords = vector4(-419.43, 1225.35, 325.76, 339.56),
default_veh = 'tribike2', chosen_veh = 'tribike2',
active = true
Expand All @@ -151,11 +151,11 @@ Config.RentalLocations = {
- Set to false to remove this bike from available rentals
]]
Config.Bikes = {
[1] = { model = "bmx", label = "BMX", rental_cost = 12, available = true },
[2] = { model = "cruiser", label = "Cruiser", rental_cost = 10, available = true },
[3] = { model = "fixter", label = "Fixter", rental_cost = 20, available = true },
[4] = { model = "scorcher", label = "Scorcher", rental_cost = 15, available = true },
[5] = { model = "tribike", label = "Tribike", rental_cost = 22, available = true },
[6] = { model = "tribike2", label = "Tribike 2", rental_cost = 22, available = true },
[7] = { model = "tribike3", label = "Tribike 3", rental_cost = 22, available = true },
[1] = { model = 'bmx', label = 'BMX', rental_cost = 12, available = true },
[2] = { model = 'cruiser', label = 'Cruiser', rental_cost = 10, available = true },
[3] = { model = 'fixter', label = 'Fixter', rental_cost = 20, available = true },
[4] = { model = 'scorcher', label = 'Scorcher', rental_cost = 15, available = true },
[5] = { model = 'tribike', label = 'Tribike', rental_cost = 22, available = true },
[6] = { model = 'tribike2', label = 'Tribike 2', rental_cost = 22, available = true },
[7] = { model = 'tribike3', label = 'Tribike 3', rental_cost = 22, available = true },
}

0 comments on commit 922b6ed

Please sign in to comment.