-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.lua
143 lines (123 loc) · 8.15 KB
/
config.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
Config = {}
Config.Locations = {
["insurances"] = {
vector4(296.4421, -591.3871, 43.2757, 65.5415), -- Coordinates for the insurance location. You can add several possitions.
vector4(356.5758, -593.0466, 28.7821, 249.4364),
}
}
Config.FrameWork = 'esx' -- Select the framework being used: 'esx' for ESX Framework or 'qb' for QBCore Framework.
Config.UseOXNotifications = true -- Enable or disable OX Notifications. If 'true', it will use OX notifications; otherwise, it will use the default notification system for the framework.
Config.UseOxTarget = true -- Enables or disables the use of the OxTarget system.
Config.TargetName = '' -- Specifies the name of the target resource. Only needed if using qb-target or qtarget. Leave it empty if using OxTarget.
Config.TargetDistance = 7.0 -- Sets the maximum interaction distance for targeting.
Config.Account = 'money' -- Choose the account type for transactions: 'bank' to use the player's bank account or 'money' to use cash.
Config.OnlyAllowedJobs = false -- Enable or disable restricted access to the insurance menu. If 'true', only specific jobs can access. If 'false', everyone can access.
Config.AllowedJobs = {"ambulance", "police", "safd"} -- List of allowed jobs. Only these jobs can access the insurance menu when 'OnlyAllowedJobs' is set to true.
Config.DiscountJobs = { "ambulance" } -- List of jobs that are allowed to sell insurance at a discounted rate.
Config.UseDiscounts = true -- Setting this to true allows players (with specified jobs) to sell insurance at a discounted rate.
Config.CheckInsuranceCommandJob = { "ambulance" } -- List of jobs allowed to use the command to check insurance status.
Config.DiscountInteractionDistance = '3.0' -- The maximum distance at which players can interact with another player to apply discounts.
Config.PeriodicallyDeleteInsurance = 3600000 -- The interval (in milliseconds) at which expired insurances will be cleaned from the database.
Config.TargetIcon = 'fa fa-clipboard' -- The icon used for the targeting box when interacting with insurance locations.
Config.ZoneLabel = 'Seguros Médicos' -- The label displayed for the insurance interaction zone.
Config.PedModel = "s_m_m_doctor_01" -- The model used for the insurance NPCs.
Config.PedSpawnCheckInterval = 5000 -- The interval (in milliseconds) at which the script checks if insurance NPCs need to be spawned.
Config.PedInteractionDistance = 2.0 -- The distance at which players can interact with the insurance NPCs.
Config.BlipLabel = 'Seguros Médicos' -- The label displayed for the blip on the map, indicating the location of medical insurance services.
Config.ShowBlip = true -- Enable or disable the display of the blip on the map. If 'true', the blip will be shown; if 'false', it will be hidden.
Config.BlipSprite = 408 -- The sprite ID for the blip, determining its appearance on the map.
Config.BlipScale = 0.8 -- The scale of the blip on the map.
Config.BlipColour = 0 -- The color of the blip on the map.
Config.AccessDeniedTitle = 'Acceso Denegado' -- The title displayed in notifications when access to a feature is denied.
Config.AccessDeniedMessage = 'No tienes el trabajo adecuado para acceder a esta función.' -- The message displayed in notifications when access to a feature is denied.
Config.NotificationDuration = '5000' -- The duration (in milliseconds) for which notifications are displayed.
Config.DiscountAppliedTitle = 'Descuento aplicado' -- The title displayed in notifications when a discount is successfully applied.
Config.DiscountAppliedMessage = 'Has vendido un seguro con descuento al jugador más cercano.' -- The message displayed in notifications when a discount is successfully applied.
Config.ErrorTitle = 'Error' -- The title displayed in error notifications.
Config.NoPlayerNearbyMessage = 'No hay ningún jugador cerca para aplicar el descuento.' -- The message displayed when there are no players nearby to apply a discount.
Config.DiscountAlreadyUsedTitle = 'Descuento ya utilizado' -- The title displayed when a player tries to use a discount they have already used.
Config.DiscountAlreadyUsedMessage = 'Ya has usado el descuento para esta sesión.' -- The message displayed when a player tries to use a discount they have already used.
Config.AutoRunSQL = true -- Enable or disable automatic integration of the SQL table needed for this script.
Config.AutoVersionChecker = true -- Enable or disable the automatic version checker. If 'true', it will check for updates and warn you if the script isn't up to date.
-- Edit this function to suit your requirements
function openInsuranceMenu(insuranceData)
local options = {}
if insuranceData then
-- Si el jugador tiene un seguro, mostrar los detalles del seguro actual.
table.insert(options, {
title = locale('current_insurance'),
description = locale('insurance_type') .. ': ' .. insuranceData.type .. '\n' .. locale('time_left') .. ': ' .. insuranceData.timeLeft,
icon = 'info-circle',
disabled = false -- La opción está habilitada ya que el jugador tiene seguro.
})
else -- Si el jugador no tiene seguro.
-- Notificar al jugador que actualmente no tiene seguro.
table.insert(options, {
title = locale('no_current_insurance'),
icon = 'info-circle',
disabled = true -- La opción está deshabilitada ya que el jugador no tiene seguro.
})
table.insert(options, {
title = locale('basic_insurance'),
description = locale('duration') .. ': 3 ' .. locale('days') .. '\n' .. locale('price') .. ': $10000',
icon = 'circle',
event = 'muhaddil_insurances:insurance:buy',
args = { type = "basico", duration = 3, price = 10000 } -- Argumentos para el evento.
})
table.insert(options, {
title = locale('weekly_insurance'),
description = locale('duration') .. ': 7 ' .. locale('days') .. '\n' .. locale('price') .. ': $25000',
icon = 'circle',
event = 'muhaddil_insurances:insurance:buy',
args = { type = "semanal", duration = 7, price = 25000 } -- Argumentos para el evento.
})
table.insert(options, {
title = locale('full_insurance'),
description = locale('duration') .. ': 15 ' .. locale('days') .. '\n' .. locale('price') .. ': $50000',
icon = 'circle',
event = 'muhaddil_insurances:insurance:buy',
args = { type = "completo", duration = 15, price = 50000 } -- Argumentos para el evento.
})
table.insert(options, {
title = locale('premium_insurance'),
description = locale('duration') .. ': 30 ' .. locale('days') .. '\n' .. locale('price') .. ': $100000',
icon = 'circle',
event = 'muhaddil_insurances:insurance:buy',
args = { type = "premium", duration = 30, price = 100000 } -- Argumentos para el evento.
})
if CanSellDiscountInsurance() then
table.insert(options, {
title = locale('sell_discount_insurance'),
description = locale('duration') .. ': 30 ' .. locale('days') .. '\n' .. locale('price') .. ': $50000 (' .. locale('discount') .. ')',
icon = 'circle',
event = 'muhaddil_insurances:insurance:buyDiscount',
args = { type = "premium", duration = 30, price = 50000 }
})
end
end
lib.registerContext({
id = 'insurance_menu',
title = locale('insurance_menu_title'),
options = options
})
lib.showContext('insurance_menu')
end
function openSellInsurance()
local options = {}
table.insert(options, {
title = locale('sell_custom_insurance'),
description = locale('custom_insurance_description'),
icon = 'circle',
event = 'muhaddil_insurances:insurance:customPrice'
})
lib.registerContext({
id = 'insurance_menu_sell',
title = locale('insurance_menu_title'),
options = options
})
lib.showContext('insurance_menu_sell')
end
Config.EnableSellCommand = true
Config.CanSellInsuraceToHimself = true
Config.SellInsuraceRange = 5.0
Config.SellInsuraceMaxDays = 30