Configs, Locales & SQL

Codesign resources contain various editable/unobscured files such as client/server functions etc.

Config = {}
Config.Keys={['ESC']=322,['F1']=288,['F2']=289,['F3']=170,['F5']=166,['F6']=167,['F7']=168,['F8']=169,['F9']=56,['F10']=57,['~']=243,['1']=157,['2']=158,['3']=160,['4']=164,['5']=165,['6']=159,['7']=161,['8']=162,['9']=163,['-']=84,['=']=83,['BACKSPACE']=177,['TAB']=37,['Q']=44,['W']=32,['E']=38,['R']=45,['T']=245,['Y']=246,['U']=303,['P']=199,['[']=39,[']']=40,['ENTER']=18,['CAPS']=137,['A']=34,['S']=8,['D']=9,['F']=23,['G']=47,['H']=74,['K']=311,['L']=182,['LEFTSHIFT']=21,['Z']=20,['X']=73,['C']=26,['V']=0,['B']=29,['N']=249,['M']=244,[',']=82,['.']=81,['LEFTCTRL']=36,['LEFTALT']=19,['SPACE']=22,['RIGHTCTRL']=70,['HOME']=213,['PAGEUP']=10,['PAGEDOWN']=11,['DELETE']=178,['LEFTARROW']=174,['RIGHTARROW']=175,['TOP']=27,['DOWNARROW']=173,['NENTER']=201,['N4']=108,['N5']=60,['N6']=107,['N+']=96,['N-']=97,['N7']=117,['N8']=61,['N9']=118,['UPARROW']=172,['INSERT']=121}


--███████╗██████╗  █████╗ ███╗   ███╗███████╗██╗    ██╗ ██████╗ ██████╗ ██╗  ██╗
--██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝██║    ██║██╔═══██╗██╔══██╗██║ ██╔╝
--█████╗  ██████╔╝███████║██╔████╔██║█████╗  ██║ █╗ ██║██║   ██║██████╔╝█████╔╝ 
--██╔══╝  ██╔══██╗██╔══██║██║╚██╔╝██║██╔══╝  ██║███╗██║██║   ██║██╔══██╗██╔═██╗ 
--██║     ██║  ██║██║  ██║██║ ╚═╝ ██║███████╗╚███╔███╔╝╚██████╔╝██║  ██║██║  ██╗
--╚═╝     ╚═╝  ╚═╝╚═╝  ╚═╝╚═╝     ╚═╝╚══════╝ ╚══╝╚══╝  ╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═╝


Config.Database = 'mysql' --[ 'mysql' / 'ghmattimysql' / 'oxmysql' ] Choose your sql database script.
Config.Framework = 'esx' ---[ 'esx' / 'qbcore' / 'vrp' / 'none' / 'other' ] Choose your framework.
Config.Language = 'EN' --[ 'EN' / 'BG' / 'DE' / 'CZ' / 'ES' / 'FI' / 'FR' / 'NL'  / 'SE' / 'SK' ] You can add your own locales to the Locales.lua. But make sure to change the Config.Language to match it.

Config.ESX_version = '1.1' --[ '1.1' / '1.2' / '1.final' / 'exm' / 'legacy' ] "IF" you are using esx, choose the version you are using.
Config.FrameworkTriggers = { --You can change the esx/qbcore events (IF NEEDED).
    main = 'esx:getSharedObject',   --ESX = 'esx:getSharedObject'   QBCORE = 'QBCore:GetObject'
    load = 'esx:playerLoaded',      --ESX = 'esx:playerLoaded'      QBCORE = 'QBCore:Client:OnPlayerLoaded'
    job = 'esx:setJob',             --ESX = 'esx:setJob'            QBCORE = 'QBCore:Client:OnJobUpdate'
	resource_name = 'es_extended'   --ESX = 'es_extended'           QBCORE = 'qb-core'
}

Config.NotificationType = { --[ 'esx' / 'qbcore' / 'mythic_old' / 'mythic_new' / 'chat' / 'other' ] Choose your notification script.
    server = 'esx',
    client = 'esx' 
}


--███╗   ███╗ █████╗ ██╗███╗   ██╗
--████╗ ████║██╔══██╗██║████╗  ██║
--██╔████╔██║███████║██║██╔██╗ ██║
--██║╚██╔╝██║██╔══██║██║██║╚██╗██║
--██║ ╚═╝ ██║██║  ██║██║██║ ╚████║
--╚═╝     ╚═╝╚═╝  ╚═╝╚═╝╚═╝  ╚═══╝


Config.LoopWait = 500 --(in ms) The refresh timer for updating the values on the UI. (a lower number will use more ms in resmon and a higher number will use less).
Config.PlaySound = true --Do you want to use the sounds when using the watch?

Config.StaffCommands = {
    ResetStatus = 'resetstatus', --The command for staff to reset their hunger/thirst/stress stats.

    Perms = { --You decide which permission groups can use the staff command ^.
        ['esx'] = {'superadmin', 'admin', 'mod'},
        ['qbcore'] = {'god', 'admin'},
        ['other'] = {'change_me', 'change_me'}
    }
}


--██╗  ██╗███████╗██╗   ██╗███████╗     █████╗ ███╗   ██╗██████╗      ██████╗ ██████╗ ███╗   ███╗███╗   ███╗ █████╗ ███╗   ██╗██████╗ ███████╗
--██║ ██╔╝██╔════╝╚██╗ ██╔╝██╔════╝    ██╔══██╗████╗  ██║██╔══██╗    ██╔════╝██╔═══██╗████╗ ████║████╗ ████║██╔══██╗████╗  ██║██╔══██╗██╔════╝
--█████╔╝ █████╗   ╚████╔╝ ███████╗    ███████║██╔██╗ ██║██║  ██║    ██║     ██║   ██║██╔████╔██║██╔████╔██║███████║██╔██╗ ██║██║  ██║███████╗
--██╔═██╗ ██╔══╝    ╚██╔╝  ╚════██║    ██╔══██║██║╚██╗██║██║  ██║    ██║     ██║   ██║██║╚██╔╝██║██║╚██╔╝██║██╔══██║██║╚██╗██║██║  ██║╚════██║
--██║  ██╗███████╗   ██║   ███████║    ██║  ██║██║ ╚████║██████╔╝    ╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ╚═╝ ██║██║  ██║██║ ╚████║██████╔╝███████║
--╚═╝  ╚═╝╚══════╝   ╚═╝   ╚══════╝    ╚═╝  ╚═╝╚═╝  ╚═══╝╚═════╝      ╚═════╝ ╚═════╝ ╚═╝     ╚═╝╚═╝     ╚═╝╚═╝  ╚═╝╚═╝  ╚═══╝╚═════╝ ╚══════╝


Config.Keys = {
	move_mode = Config.Keys['K'], --Key to activate move mode. (K by default and right mouse click to disable).
	next_screen = Config.Keys['RIGHTARROW'], --This is the key to cycle to the next screen. (RIGHT ARROW by default).
	previous_screen = Config.Keys['LEFTARROW'], --If Config.ToggleMode is set to double, then this is the key to move back to the previous screen. (LEFT ARROW by default).
}

Config.OpenWatch = {
	key_mapping = {
		ENABLE = true, --If this is disabled, none of the options below in this table will not used.
		command = 'watchhud', --Customise the chat command.
		key = 'i', --Customise the key.
		description = 'Open the watch UI', --Customise the description for the chat message.
	},

	usable_item = {
		ENABLE = true, --If this is disabled, none of the options below in this table will not used.
    	item_name = 'watch', --Customise the item name.
	}
}


--██████╗  █████╗ ███████╗██╗ ██████╗    ███╗   ██╗███████╗███████╗██████╗ ███████╗
--██╔══██╗██╔══██╗██╔════╝██║██╔════╝    ████╗  ██║██╔════╝██╔════╝██╔══██╗██╔════╝
--██████╔╝███████║███████╗██║██║         ██╔██╗ ██║█████╗  █████╗  ██║  ██║███████╗
--██╔══██╗██╔══██║╚════██║██║██║         ██║╚██╗██║██╔══╝  ██╔══╝  ██║  ██║╚════██║
--██████╔╝██║  ██║███████║██║╚██████╗    ██║ ╚████║███████╗███████╗██████╔╝███████║
--╚═════╝ ╚═╝  ╚═╝╚══════╝╚═╝ ╚═════╝    ╚═╝  ╚═══╝╚══════╝╚══════╝╚═════╝ ╚══════╝


--NOTE: The built in basic needs system will only work on ESX servers; unless you change the code.
Config.BasicNeeds = {
	ENABLE = true, --Do you want to use the built in hunger & thirst basic needs system?
	save_in_database = true, --Do you want the hunger & thirst to be saved in the database?
	cache_status_timer = 10, --(in minutes) Every x amount of minutes a player's hunger & thirst will be cached in the server side. (it will only be saved to the database when a player exits the server).
	timer = 1, --(in minutes) Every x amount of minutes a player's hunger & thirst will be decreased by 1. (100 is full and 0 is empty).

	EmptyEffect = {
		screenblur = false, --When a player's hunger or thirst is 0 their screen will blur.

		healthloss = false, --When a player's hunger or thirst is 0 their health will start to decrease.
		healthloss_timer = 5, --(in seconds) Every x amount of seconds a player's health will decrease by 1. (max health is 200, 0 means they will die).
	},


	Items = { --A list of usable food/drink items for the built in basic needs system.
        [1] = {
			item_name = 'bread', --The usable item spawn name.
			item_label = 'Sandwich', --The label of the usable item.
			item_type = 'food', --[ 'food' / 'drink' ]
			StatusInfo = {
				hunger = 20, --20 will add 20 hunger. -20 will remove 20 hunger. 0 will not add/remove anything. (100 is full hunger and 0 is empty).
				thirst = 0, --20 will add 20 thirst. -20 will remove 20 thirst. 0 will not add/remove anything. (100 is full thirst and 0 is empty).
				stress = 0 --20 will add 20 stress. -20 will remove 20 stress. 0 will not add/remove anything. (100 is full stress and 0 is empty).
			},
			PropInfo = {
				hash = `prop_sandwich_01`, --The spawn name of the prop.
				anim_dict = 'mp_player_inteat@burger', --An eating animation.
				anim_name = 'mp_player_int_eat_burger_fp', --An eating animation.
				duration = 5000, --How long the animation will last.
				x = 0.13, y = 0.05, z = 0.02, pitch = 50.0, roll = 50.0, yaw = 60.0, bone = 18905 --Position of the prop on the player. (DON'T CHANGE THIS IF YOU DONT KNOW WHAT YOUR DOING).
			}  
		},

        [2] = {
			item_name = 'water',
			item_label = 'Water',
			item_type = 'drink',            
            StatusInfo = {
                hunger = 0,
                thirst = 20,
                stress = 0
            },
            PropInfo = {
                hash = `prop_ld_flow_bottle`,
                anim_dict = 'mp_player_intdrink', --A drinking animation.
                anim_name = 'loop_bottle', --A drinking animation.
                duration = 5000,
                x = 0.10, y = -0.03, z = 0.03, pitch = -100.0, roll = 0.0, yaw = -10.0, bone = 18905
            }  
        },
		
		--[[ YOU CAN ADD MORE USABLE FOOD/DRINK ITEMS HERE BY COPY AND PASTING THIS TABLE.
		[3] = {
			item_name = 'bread',
			item_label = 'Sandwich',
			item_type = 'food',
			StatusInfo = {
				hunger = 20,
				thirst = 0,
				stress = 0
			},
			PropInfo = {
				hash = `prop_sandwich_01`,
				anim_dict = 'mp_player_inteat@burger',
				anim_name = 'mp_player_int_eat_burger_fp',
				duration = 5000,
				x = 0.13, y = 0.05, z = 0.02, pitch = 50.0, roll = 50.0, yaw = 60.0, bone = 18905
			}  
		},
		]]
    }
}


--███████╗████████╗██████╗ ███████╗███████╗███████╗
--██╔════╝╚══██╔══╝██╔══██╗██╔════╝██╔════╝██╔════╝
--███████╗   ██║   ██████╔╝█████╗  ███████╗███████╗
--╚════██║   ██║   ██╔══██╗██╔══╝  ╚════██║╚════██║
--███████║   ██║   ██║  ██║███████╗███████║███████║
--╚══════╝   ╚═╝   ╚═╝  ╚═╝╚══════╝╚══════╝╚══════╝


Config.Stress = {
	ENABLE = true, --Do you want to use our built in stress system?
	save_in_database = true, --Do you want the stress to be saved in the database? NOTE: Stress will only save to the database on ESX/QBCore servers; unless you change the code.
	cache_status_timer = 10, --(in minutes) Every x amount of minutes a player's stress will be cached in the server side. (it will only be saved to the database when a player exits the server). (if 'Config.BasicNeeds.ENABLE' is enabled, the timer from that table will overwrite this timer).
	health_decrease_amount = 5, --If your stress is high you will loose health slowly.

	Values = { --0 is no stress and 100 stress is max stress.
		Bike = {
			GainStress = true, --Do you want player's to gain stress when on motorcycles.
			IncreaseSpeed = 150, --If you are above 150mph you will gain stress.
			IncreaseAmount = 5, --Stress will increase by this amount (out of 100) if your speed is above the amount set above.
			LowerSpeed_min = 20,
			LowerSpeed_max = 70, --Stress will decrease if your speed in mph is between the min and max ^.
			LowerAmount = 2, --Stress will decrease by this amount (out of 100) if your speed is between the min and max.
		},
	
		Car = {
			GainStress = true,
			IncreaseSpeed = 150,
			IncreaseAmount = 2,
			LowerSpeed_min = 20,
			LowerSpeed_max = 60,
			LowerAmount = 1,
		},
	
		Plane = {
			GainStress = true,
			IncreaseSpeed = 150,
			IncreaseAmount = 2,
		},
	
		Swimming = {
			LowerStress = true,
			LowerAmount = 3,
		},
	
		Combat = {
			GainStress = true,
			MeleeAmount = 1,
			FirearmAmount = 2,
		},
	
		Yoga = {
			LowerStress = true,
			LowerAmount = 1,
		},
	
		Damage = {
			GainStress = true,
			IncreaseAmount = 2,
		}
	}
}


--██╗    ██╗ █████╗ ████████╗███████╗██████╗      ██████╗ ██╗  ██╗██╗   ██╗ ██████╗ ███████╗███╗   ██╗
--██║    ██║██╔══██╗╚══██╔══╝██╔════╝██╔══██╗    ██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝██╔════╝ ██╔════╝████╗  ██║
--██║ █╗ ██║███████║   ██║   █████╗  ██████╔╝    ██║   ██║ ╚███╔╝  ╚████╔╝ ██║  ███╗█████╗  ██╔██╗ ██║
--██║███╗██║██╔══██║   ██║   ██╔══╝  ██╔══██╗    ██║   ██║ ██╔██╗   ╚██╔╝  ██║   ██║██╔══╝  ██║╚██╗██║
--╚███╔███╔╝██║  ██║   ██║   ███████╗██║  ██║    ╚██████╔╝██╔╝ ██╗   ██║   ╚██████╔╝███████╗██║ ╚████║
-- ╚══╝╚══╝ ╚═╝  ╚═╝   ╚═╝   ╚══════╝╚═╝  ╚═╝     ╚═════╝ ╚═╝  ╚═╝   ╚═╝    ╚═════╝ ╚══════╝╚═╝  ╚═══╝


Config.WaterOxygen = {
	ENABLE = true,
	--Note: After a player's oxygen reaches 0, the player will start to slowly die as they would normally. This will take around 15 extra seconds.
	underwater_decrease = 5, --Every 1 second the player will loose x amount of oxygen when under water. (0 is empty and 100 is full).
	underwater_recovery = 5, --Every 1 second the player will regain x amount of oxygen when NOT under water. (0 is empty and 100 is full).
}


-- ██████╗ ████████╗██╗  ██╗███████╗██████╗ 
--██╔═══██╗╚══██╔══╝██║  ██║██╔════╝██╔══██╗
--██║   ██║   ██║   ███████║█████╗  ██████╔╝
--██║   ██║   ██║   ██╔══██║██╔══╝  ██╔══██╗
--╚██████╔╝   ██║   ██║  ██║███████╗██║  ██║
-- ╚═════╝    ╚═╝   ╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝


function L(cd) if Locales[Config.Language][cd] then return Locales[Config.Language][cd] else print('Locale is nil ('..cd..')') end end
function Round(cd, debug) return math.floor(cd+0.5) end
function Trim(cd) return cd:gsub('%s+', '') end

if Config.Framework ~= 'esx' then
	Config.BasicNeeds.ENABLE = false --NOTE: The built in basic needs system will only work on ESX servers; unless you change the code.
end
if Config.Framework ~= 'esx' and Config.Framework ~= 'qbcore' then
	Config.Stress.save_in_database = false --NOTE: Stress will only save to the database on ESX/QBCore servers; unless you change the code.
end

Last updated