Events

ESX = exports.es_extended:getSharedObject()

-- Function Air Suspension
function AirSuspensionMenu()
    lib.registerContext({
        id = 'AirSuspension',
        title = 'Air Suspension',
        options = {
            { title = '๐Ÿ”ธStock',         description = 'Click here to adjust the suspension', event = Config.Prefix..":client:AirSuspension", args = 1 },
            { title = '๐Ÿ”นLevel 1',       description = 'Click here to adjust the suspension', event = Config.Prefix..":client:AirSuspension", args = 2 },
            { title = '๐Ÿ”นLevel 2',       description = 'Click here to adjust the suspension', event = Config.Prefix..":client:AirSuspension", args = 3 },
            { title = '๐Ÿ”นLevel 3',       description = 'Click here to adjust the suspension', event = Config.Prefix..":client:AirSuspension", args = 4 },
            { title = '๐Ÿ”นLevel 4',       description = 'Click here to adjust the suspension', event = Config.Prefix..":client:AirSuspension", args = 5 },
        }
    })
    lib.showContext('AirSuspension')
end

-- Function Coilovers
function coiloverMenu()
    lib.registerContext({
        id = 'CoiloverMenu',
        title = 'Coilover Menu',
        options = {
            { title = '๐Ÿ”ธStock', description = 'Click here to adjust the vehicle\'s coilovers', event = Config.Prefix..":client:applyCoilovers", args = 1 },
            { title = '๐Ÿ”นStage 1', description = 'Click here to adjust the vehicle\'s coilovers', event = Config.Prefix..":client:applyCoilovers", args = 2 },
            { title = '๐Ÿ”นStage 2', description = 'Click here to adjust the vehicle\'s coilovers', event = Config.Prefix..":client:applyCoilovers", args = 3 },
            { title = '๐Ÿ”นStage 3', description = 'Click here to adjust the vehicle\'s coilovers', event = Config.Prefix..":client:applyCoilovers", args = 4 },
            { title = '๐Ÿ”นStage 4', description = 'Click here to adjust the vehicle\'s coilovers', event = Config.Prefix..":client:applyCoilovers", args = 5 },
        }
    })
    lib.showContext('CoiloverMenu')
end

-- Function Xenons
function xenonControllerMenu()
    lib.registerContext({
		id = 'XenonLights',
		title = 'Xenon Lights',
		options = {
			{ title = '๐Ÿ”ธStock',         description = 'Click here to adjust the xenon\'s headlights', event = Config.Prefix..":client:applyXenonColor", args = 1 },
			{ title = '๐Ÿ”นIce Blue',      description = 'Click here to adjust the xenon\'s headlights', event = Config.Prefix..":client:applyXenonColor", args = 2 },
			{ title = '๐Ÿ”นBlue',          description = 'Click here to adjust the xenon\'s headlights', event = Config.Prefix..":client:applyXenonColor", args = 3 },
			{ title = '๐Ÿ”นElectric Blue', description = 'Click here to adjust the xenon\'s headlights', event = Config.Prefix..":client:applyXenonColor", args = 4 },
			{ title = '๐Ÿ”นGreen',         description = 'Click here to adjust the xenon\'s headlights', event = Config.Prefix..":client:applyXenonColor", args = 5 },
			{ title = '๐Ÿ”นGreen Lemon',   description = 'Click here to adjust the xenon\'s headlights', event = Config.Prefix..":client:applyXenonColor", args = 6 },
			{ title = '๐Ÿ”นYellow',        description = 'Click here to adjust the xenon\'s headlights', event = Config.Prefix..":client:applyXenonColor", args = 7 },
			{ title = '๐Ÿ”นGold',          description = 'Click here to adjust the xenon\'s headlights', event = Config.Prefix..":client:applyXenonColor", args = 8 },
			{ title = '๐Ÿ”นOrange',        description = 'Click here to adjust the xenon\'s headlights', event = Config.Prefix..":client:applyXenonColor", args = 9 },
			{ title = '๐Ÿ”นRed',           description = 'Click here to adjust the xenon\'s headlights', event = Config.Prefix..":client:applyXenonColor", args = 10 },
			{ title = '๐Ÿ”นPink',          description = 'Click here to adjust the xenon\'s headlights', event = Config.Prefix..":client:applyXenonColor", args = 11 },
			{ title = '๐Ÿ”นHot Pink',      description = 'Click here to adjust the xenon\'s headlights', event = Config.Prefix..":client:applyXenonColor", args = 12 },
			{ title = '๐Ÿ”นPurple',        description = 'Click here to adjust the xenon\'s headlights', event = Config.Prefix..":client:applyXenonColor", args = 13 },
			{ title = '๐Ÿ”นBlack',         description = 'Click here to adjust the xenon\'s headlights', event = Config.Prefix..":client:applyXenonColor", args = 14 },
		}
	})
	lib.showContext('XenonLights')
end

-- Open menu of cameras
RegisterNetEvent(Config.Prefix..":client:MenuCameras", function()
    lib.registerContext({
        id = 'Cameras',
        title = '๐ŸŽฅ Cรขmeras',
        options = {
            { title = '๐Ÿ”นID: #1',       description = 'Click here to access the camera', event = Config.Prefix..":client:AtivarCamera1" },
            { title = '๐Ÿ”นID: #2',       description = 'Click here to access the camera', event = Config.Prefix..":client:AtivarCamera2" },
            { title = '๐Ÿ”นID: #3',       description = 'Click here to access the camera', event = Config.Prefix..":client:AtivarCamera3" },
            { title = '๐Ÿ”นID: #4',       description = 'Click here to access the camera', event = Config.Prefix..":client:AtivarCamera4" },
        }
    })
    lib.showContext('Cameras')
end)

-- Neons

RegisterNetEvent(Config.Prefix..':client:neonMenu', function()
    lib.registerContext({
        id = 'neonMenu',
        title = '[๐Ÿšจ] Neon Underglow',
        options = {
            { title = '[โœ…] Active Neon',         description = 'Click here to adjust the neon\'s headlights', event = Config.Prefix..":client:neonToggleMenu" },
            { title = '[โ™ป๏ธ] Change Colour',       description = 'Click here to adjust the neon\'s headlights', event = Config.Prefix..":client:neonColorMenu" },
        }
    })
    lib.showContext('neonMenu')
end)

RegisterNetEvent(Config.Prefix..':client:neonToggleMenu', function()
    lib.registerContext({
        id = 'neonToggleMenu',
        title = '[๐Ÿšจ] Neon Underglow',
        options = {
            { title = '[โœ…] Turn ON',        description = 'Click here to turn on your neon\'s', event = Config.Prefix..":client:applyNeonPostion", args = 1 },
            { title = '[โŒ] Turn OFF',       description = 'Click here to turn off your neon\'s', event = Config.Prefix..":client:applyNeonPostion", args = 2 },
        }
    })
    lib.showContext('neonToggleMenu')
end)

RegisterNetEvent(Config.Prefix..":client:neonColorMenu", function()
    lib.registerContext({
        id = 'NeonUnderglow',
        title = '[๐Ÿšจ] Neon Underglow',
        options = {
            { title = '๐Ÿ”นWhite',         description = 'Click here to adjust the neon\'s headlights', event = Config.Prefix..":client:applyNeonColor", args = 1 },
            { title = '๐Ÿ”นBlue',          description = 'Click here to adjust the neon\'s headlights', event = Config.Prefix..":client:applyNeonColor", args = 2 },
            { title = '๐Ÿ”นElectric Blue', description = 'Click here to adjust the neon\'s headlights', event = Config.Prefix..":client:applyNeonColor", args = 3 },
            { title = '๐Ÿ”นGreen',         description = 'Click here to adjust the neon\'s headlights', event = Config.Prefix..":client:applyNeonColor", args = 4 },
            { title = '๐Ÿ”นGreen Lemon',   description = 'Click here to adjust the neon\'s headlights', event = Config.Prefix..":client:applyNeonColor", args = 5 },
            { title = '๐Ÿ”นYellow',        description = 'Click here to adjust the neon\'s headlights', event = Config.Prefix..":client:applyNeonColor", args = 6 },
            { title = '๐Ÿ”นGold',          description = 'Click here to adjust the neon\'s headlights', event = Config.Prefix..":client:applyNeonColor", args = 7 },
            { title = '๐Ÿ”นOrange',        description = 'Click here to adjust the neon\'s headlights', event = Config.Prefix..":client:applyNeonColor", args = 8 },
            { title = '๐Ÿ”นRed',           description = 'Click here to adjust the neon\'s headlights', event = Config.Prefix..":client:applyNeonColor", args = 9 },
            { title = '๐Ÿ”นPink',          description = 'Click here to adjust the neon\'s headlights', event = Config.Prefix..":client:applyNeonColor", args = 10 },
            { title = '๐Ÿ”นLight Pink',    description = 'Click here to adjust the neon\'s headlights', event = Config.Prefix..":client:applyNeonColor", args = 11 },
            { title = '๐Ÿ”นHot Pink',      description = 'Click here to adjust the neon\'s headlights', event = Config.Prefix..":client:applyNeonColor", args = 12 },
            { title = '๐Ÿ”นBlack',         description = 'Click here to adjust the neon\'s headlights', event = Config.Prefix..":client:applyNeonColor", args = 13 },
        }
    })
    lib.showContext('NeonUnderglow')
end)

-- Menu Vehicles List
RegisterNetEvent(Config.Prefix..":Client:VehiclesMenu", function()
    lib.registerContext({
        id = 'MechanicVehicles',
        title = '๐Ÿš— Mechanic Vehicles',
        options = {
            { title = '๐Ÿ“ƒ Vehicle List',         description = '', event = Config.Prefix..":client:ListaVeiculos" },
            { title = '๐Ÿ“ฅ Return Vehicle',       description = '', event = Config.Prefix..":Client:ReturnVehicle" },
        }
    })
    lib.showContext('MechanicVehicles')
end)

-- Function DrawText
function DrawText3Ds(x, y, z, text)
    SetTextScale(0.35, 0.35)
    SetTextFont(4)
    SetTextProportional(1)
    SetTextColour(255, 255, 255, 215)
    SetTextEntry("STRING")
    SetTextCentre(true)
    AddTextComponentString(text)
    SetDrawOrigin(x,y,z, 0)
    DrawText(0.0, 0.0)
    local factor = (string.len(text)) / 370
    DrawRect(0.0, 0.0+0.0125, 0.017+ factor, 0.03, 0, 0, 0, 75)
    ClearDrawOrigin()
end

Last updated