Accessible code
Config = {
Locale = 'en',
DefaultSettings = {
MinFloors = 2,
MaxFloors = 50
},
Commands = {
OpenCreator = "elevators"
},
AllowedGroups = { -- groups allowed to use /elevators command
"admin",
"god"
},
AvailableVehicles = {
{ model = "sultan", name = "Sultan", class = "Sports" },
{ model = "police", name = "Police Car", class = "Emergency" },
{ model = "ambulance", name = "Ambulance", class = "Emergency" },
{ model = "firetruk", name = "Fire Truck", class = "Emergency" },
{ model = "benson", name = "Benson", class = "Commercial" },
{ model = "stretch", name = "Stretch", class = "Luxury" },
{ model = "buzzard", name = "Buzzard", class = "Aircraft" },
{ model = "flatbed", name = "Flatbed", class = "Industrial" },
{ model = "insurgent", name = "Insurgent", class = "Military" },
{ model = "taxi", name = "Taxi", class = "Service" },
{ model = "t20", name = "T20", class = "Sports"},
{ model = "zentorno", name = "Zentorno", class = "Sports"}
},
InteractionType = "textui", -- "3dtext", "textui", or "target"
TextUI = {
Text = {
Target = "Use Elevator", -- Text for target system (without [E])
Regular = "[E] Use Elevator" -- Text for textui and 3dtext
},
Position = "right", -- "bottom" or "right"
Style = "modern" -- "default" or "modern"
},
TargetSystem = "qb-target", -- "qb-target" or "ox_target"
InteractionDistance = 2.0,
DrawDistance = 10.0,
InteractionKey = 38, -- https://docs.fivem.net/docs/game-references/controls/
MarkerSettings = {
onFoot = {
type = 2,
size = vector3(0.2, 0.2, 0.2),
color = vector4(120, 100, 255, 100),
heightOffset = 0.3
},
inVehicle = {
type = 36,
size = vector3(1.0, 1.0, 1.0),
color = vector4(120, 100, 255, 100),
heightOffset = 0
}
},
Logs = {
EnableDiscord = true, -- Set to false to disable Discord webhooks
DiscordWebhook = "", -- Your Discord webhook URL
SaveToDatabase = true, -- Set to false to disable database logging
MaxLogsToKeep = 1000, -- Maximum number of logs to keep in the database
LogColors = {
create = 65340, -- Green
update = 16750848, -- Orange
delete = 16711680, -- Red
use = 39423, -- Blue
maintenance = 10181046, -- Purple
other = 7506394 -- Gray
}
}
}
QBCore = exports['qb-core']:GetCoreObject()
Locales['en'] = {
--- # UI # ---
['ui.admin_menu'] = 'Admin Mmnu',
['ui.just_now'] = 'Just Now',
['ui.unknown_action'] = 'Unknown action',
['ui.invalid_elevator_data'] = 'Invalid elevator data',
['ui.invalid_elevator_id'] = 'Invalid elevator ID',
['ui.setting_new_floor_1'] = 'Setting New Floor %s Position~n~Press ~b~E~w~ to set',
['ui.setting_new_floor_2'] = 'Setting Floor %s Position~n~Press ~b~E~w~ to set',
['ui.setting_new_floor_3'] = 'Setting Floor Position~n~Press ~b~E~w~ to set',
['ui.adding_new_floor_1'] = 'Setting New Floor %s Position~n~Press ~b~E~w~ to set',
['ui.adding_new_floor_2'] = 'Setting Floor %s Position~n~Press ~b~E~w~ to set',
['ui.adding_new_floor_3'] = 'Setting Floor Position~n~Press ~b~E~w~ to set',
['ui.editing_floor_position'] = 'Editing Floor %s Position~n~Press ~b~E~w~ to set',
['ui.vehicle_elevator'] = 'Vehicle Elevator [~b~E~w~]',
['ui.elevator'] = 'Elevator [~b~E~w~]',
--- # UI # ---
--- # Notify # ---
['notify.no_permission'] = 'You do not have permission to use this command',
['notify.missing_data'] = 'Missing required data',
['notify.floor_not_found'] = 'Floor not found',
['notify.no_elevator_data'] = 'No elevator data found',
['notify.invalid_passcode'] = 'Invalid passcode',
['notify.floor_added'] = 'Floor successfully added',
['notify.floor_position_set'] = 'Floor %s position set',
['notify.no_floor_coords_found'] = 'No floor coordinates found',
['notify.no_data_provided'] = 'No data provided',
['notify.invalid_task_data'] = 'Invalid task data',
['notify.invalid_task_id'] = 'Invalid task ID',
['notify.no_floor_specified'] = 'No floor specified',
['notify.new_floor_position_set'] = 'New floor %s position set',
['notify.floor_position_set'] = 'Floor %s position set',
['notify.failed_to_update_position'] = 'Failed to update floor position',
['notify.failed_to_load_data'] = 'Failed to load elevator data',
['notify.elevator_no_access'] = 'You don\'t have access to this elevator',
['notify.veh_cant_use_elevator'] = 'This vehicle cannot use this elevator',
['notify.player_not_found'] = 'Player not found',
['notify.elevator_name_exists'] = 'An elevator with this name already exists',
['notify.invalid_elevator_name'] = 'Invalid elevator name',
['notify.invalid_floor_count'] = 'Invalid floor count',
['notify.elevator_created_succ'] = 'Elevator created successfully',
['notify.elevator_deleted_succ'] = 'Elevator deleted successfully',
['notify.floor_position_updated'] = 'Floor position updated successfully',
['notify.elevator_updated_succ'] = 'Elevator updated successfully',
['notify.floor_deleted_succ'] = 'Floor deleted successfully',
['notify.floor_added_succ'] = 'Floor added successfully',
['notify.ele_access_succ'] = 'Elevator access updated successfully',
['notify.database_error'] = 'Database error occurred',
['notify.error_deleting_elevator'] = 'Error deleting elevator',
['notify.elevator_not_found'] = 'Elevator not found',
['notify.error_parsing_data'] = 'Error parsing elevator data',
['notify.no_floor_data_found'] = 'No floor data found',
['notify.no_floor_coordinates_found'] = 'No floor coordinates found',
['notify.invalid_data_provided'] = 'Invalid data provided',
['notify.no_floor_data'] = 'Elevator has no floor data',
['notify.no_floors_to_delete'] = 'Elevator has no floors to delete',
['notify.failed_add_maintask'] = 'Failed to add maintenance task',
['notify.maintask_added'] = 'Maintenance task added successfully',
['notify.maintask_updated'] = 'Maintenance task updated successfully',
['notify.maintask_deleted'] = 'Maintenance task deleted successfully',
['notify.maintask_notfound'] = 'Maintenance task not found',
['notify.maintask_failedupdate'] = 'Failed to update maintenance task',
['notify.maintask_failedelete'] = 'Failed to delete maintenance task',
['notify.logscleared'] = 'All logs cleared successfully',
['notify.failed_export_file'] = 'Failed to create export file',
['notify.export_saved'] = 'Export saved successfully. File location: %s',
--- # Notify # ---
--- # Logs # ---
['logs.action'] = 'Action',
['logs.player'] = 'Player',
['logs.elevator_id'] = 'Elevator ID: ',
['logs.elevator_created'] = 'Elevator Created',
['logs.elevator_created_desc'] = 'New elevator %s was created with %s floors',
['logs.elevator_deleted'] = 'Elevator Deleted',
['logs.elevator_deleted_desc'] = 'Elevator %s was permanently deleted',
['logs.elevator_updated_case1'] = 'name changed from \'%s\' to \'%s\'',
['logs.elevator_updated_case2'] = 'status changed from \'%s\' to \'%s\'',
['logs.elevator_updated_case3'] = 'various settings updated',
['logs.elevator_updated'] = 'Elevator Updated',
['logs.elevator_updated_desc'] = 'Elevator \'%s\' was updated: %s',
['logs.floor_added'] = 'Floor Added',
['logs.floor_added_desc'] = 'New floor %s added to elevator %s',
['logs.floor_position_updated'] = 'Floor Position Updated',
['logs.floor_position_updated_desc'] = 'Position of floor %s updated for elevator %s',
['logs.floor_deleted'] = 'Floor Deleted',
['logs.floor_deleted_desc'] = 'Position of floor %s updated for elevator %s',
['logs.ele_access_updated'] = 'Elevator Access Updated',
['logs.ele_access_updated_desc'] = 'Access settings updated for elevator \'%s\' to \'%s\'',
['logs.maintask_added'] = 'Maintenance Task Added',
['logs.maintask_added_desc'] = 'New maintenance task added for elevator \'%s\': %s',
['logs.maintask_updated'] = 'Maintenance Task Updated',
['logs.maintask_updated_desc'] = 'Maintenance task updated for elevator \'%s\': %s',
['logs.maintask_deleted'] = 'Maintenance Task Deleted',
['logs.maintask_deleted_desc'] = 'Maintenance task deleted for elevator \'%s\': %s',
--- # Logs # ---
}
function ShowNotification(message, type)
SendNUIMessage({ -- bult in notifications
type = "showToast",
message = message,
toastType = type
})
-- if type == "success" then
-- QBCore.Functions.Notify(message, "success")
-- elseif type == "error" then
-- QBCore.Functions.Notify(message, "error")
-- end
end
RegisterNetEvent('uniq-elevators:showNotification')
AddEventHandler('uniq-elevators:showNotification', function(message, type)
ShowNotification(message, type)
end)
Last updated