### Adding ESX Infinity to Server Configuration Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/infinity/installation.md This line must be added to your FiveM server.cfg file to ensure that the ESX Infinity resource is started when the server launches. It should be placed appropriately within the configuration file, typically after dependencies. ```Configuration ensure esx-infinity ``` -------------------------------- ### Install Dependencies (Yarn) Source: https://github.com/esx-framework/esx-documentation/blob/main/README.md Installs the project dependencies listed in the package.json file using the Yarn package manager. ```Shell $ yarn ``` -------------------------------- ### Start Local Development Server (Yarn) Source: https://github.com/esx-framework/esx-documentation/blob/main/README.md Starts a local development server for the Docusaurus website, typically with hot-reloading enabled. Opens the site in a browser. ```Shell $ yarn start ``` -------------------------------- ### Example Usage - ESX.CreateBlip - Lua Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/infinity/client/createblip.md Provides an example of how to call the ESX.CreateBlip function with specific values to create a blip for a 24/7 store at a given coordinate. ```Lua ESX.CreateBlip("shops| 24/7", "24/7 Store",vector3(373.59,325.52,103.57),59,0.8,25) ``` -------------------------------- ### Complete ESX Menu Implementation Example Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/addons/menu_default/create_menu.md A full example combining element definitions, the ESX.UI.Menu.Open function call, and the OnSelect and Cancel callback functions. This snippet demonstrates how to create, configure, and handle user interactions for a complete menu interface. ```Lua local Elements = { {label = "I`m An Element", name = "element1"}, {label = "Bread - £200", name = "bread", value = 1, type = 'slider', min = 1,max = 100}, {label = 'HEY! IM GREEN!/span>', name = "geen_element"} } ESX.UI.Menu.Open("default", GetCurrentResourceName(), "Example_Menu", { title = "Example Menu", -- The Name of Menu to show to users, align = 'top-left', -- top-left | top-right | bottom-left | bottom-right | center | elements = Elements -- define elements as the pre-created table }, function(data,menu) -- OnSelect Function --- for a simple element if data.current.name == "element1" then print("Element 1 Selected") menu.close() end -- for slider elements if data.current.name == "bread" then print(data.current.value) if data.current.value == 69 then print("Nice!") menu.close() end end end, function(data, menu) -- Cancel Function print("Closing Menu") menu.close() -- close menu end) ``` -------------------------------- ### Cloning ESX Infinity Repository using Git Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/infinity/installation.md This command sequence navigates into the 'resources' directory and then clones the ESX Infinity GitHub repository into it. This is the recommended method for downloading the framework's core files. ```Shell cd resources git clone https://github.com/esx-framework/esx-infinity ``` -------------------------------- ### Example - Toggle Shop Blips - Lua Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/infinity/client/toggleblip.md An example demonstrating how to use `ESX.ToggleBlip` to toggle the visibility of blips registered with the name 'shops|'. ```lua -- Will Toggle Visibility For any registered Shop Blips ESX.ToggleBlip("shops|") ``` -------------------------------- ### Example: Initialize ESX via Export in Lua Script Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/tutorials/tutorials-esx/sharedevent.md This is an example demonstrating how to initialize the ESX object using the export method by adding this line to the beginning of client and server Lua scripts. ```Lua ESX = exports["es_extended"]:getSharedObject() ``` -------------------------------- ### Example: Configure ESX Import in fxmanifest.lua Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/tutorials/tutorials-esx/sharedevent.md This is an example demonstrating how to configure the recommended ESX import method by adding the necessary line to the `fxmanifest.lua` or `__resource.lua` file. ```Lua shared_script '@es_extended/imports.lua' ``` -------------------------------- ### Example esx_basicneeds:onUse Event Handler (Lua) Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/addons/esx_basicneeds/events/onuse.md This example demonstrates how to implement a handler for the esx_basicneeds:onUse event. It shows how to access the item type and prop name, set a default prop if needed, and print information about the used item. ```lua AddEventHandler("esx_basicneeds:onUse", function(Type, prop_name) if not prop_name then prop_name = Type == "food" and "prop_cs_burger_01" or "prop_ld_flow_bottle2" end print(("Player Used Item! Type: %s. Prop: %s"):format(Type, prop_name)) end) ``` -------------------------------- ### Defining Simple ESX Context Menu Elements (Lua) Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/addons/esx_context/using_menu.md Demonstrates how to define basic elements for an ESX context menu, including setting an icon and title. The second example shows how to add a description below the title. ```Lua local elements = { { icon="fas fa-check", title="Item A", }, { -- simple Element with a little description underneath the Title icon="fas fa-check", title="Item A", description="Some description here. Add some words to make the text overflow." }, } ``` -------------------------------- ### Example Server Request Handler - ESX - Lua Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/infinity/server/onrequest.md Provides an example of registering a server request named 'myScript:getMeme' using ESX.OnRequest. The handler function receives the player source (src), a callback function (cb) to send data back to the client, and any client-provided arguments (param1, param2). It demonstrates calling cb to return data. ```Lua local myMemeServer = 'Meme data string' -- The first argument of the handler function is the player source (NetID), -- cb is the callback function we call when we want to return data to client -- subsequent parameters were the arguments called from the client. ESX.OnRequst('myScript:getMeme', function(src, cb, param1, param2) -- Logic needed to derive whatever data you would like to send back -- using the passed params on the handler (src, param1, param2, etc) -- Send back our meme data to client handler cb(myMemeServer) end) ``` -------------------------------- ### Example Usage - ESX.DiscordLog - Lua Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/infinity/server/discordlog.md This example demonstrates how to use the ESX.DiscordLog function to log a user joining event to a Discord webhook, specifying the webhook name, title, color, and a formatted message. ```Lua ESX.DiscordLog( "UserActions", -- Name Of Webhook "User Joined", -- Message Title "green", -- Colour "**ID**:```diff\n+ ".. _source .. "```\n**Name**:```diff\n+ ".. player_data.nametag .."```" -- Message ) ``` -------------------------------- ### Registering an ESX Command with Arguments and Suggestion (Car Spawn) Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/infinity/server/command.md Example showing how to register a 'car' command with an optional argument ('model') and a chat suggestion. It requires 'admin' permissions and creates a vehicle for the player. ```lua ESX.Command('car', 'admin', function(xPlayer, args, show_error) if not args.model then args.model = "t20" end xPlayer.emit("esx:createVehicle",args.model) end, false, { help = 'Spawn a vehicle', validate = false, arguments = {{name = 'model', type = 'any'}}}) ``` -------------------------------- ### Implementing the OnSelect Callback Function Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/addons/menu_default/create_menu.md Provides an example of the function executed when a user selects an element from the menu. It shows how to access the selected element's data (`data.current`) and perform conditional actions based on the element's name or value, such as printing information or closing the menu. ```Lua funcion(data, menu) --- for a simple element if data.current.name == "element1" then print("Element 1 Selected") menu.close() end -- for slider elements if data.current.name == "bread" then print(data.current.value) end end ``` -------------------------------- ### Example: Using GetPlayerFromId in Event Handler - Lua Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/infinity/server/getplayerfromid.md Demonstrates how to use ESX.GetPlayerFromId within an ESX event handler to get the player object from the source ID and then use it to set the player's identity. ```Lua ESX.OnClient("esx:Identity:CreateCharacter", function(source, player_data) local xPlayer = ESX.GetPlayerFromId(source) xPlayer.setIdentity(player_data) end) ``` -------------------------------- ### Example Usage of ESX.DefineState (Lua) Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/infinity/server/definestate.md This example demonstrates how to use ESX.DefineState to define multiple player data states like 'firstname', 'DOB', and 'height'. It shows how to provide default values, specify database types, and enable database saving for each state. ```Lua ESX.DefineState({ ["firstname"] = { value = "", type = "VARCHAR(255)", save = true }, ["DOB"] = { value = "21/11/2001", type = "VARCHAR(255)", save = true }, ["height"] = { value = 150, type = "INT", save = true } }) ``` -------------------------------- ### Example Using Player Function - ESX - Lua Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/infinity/server/playerfunction.md Demonstrates how to call a player function that was previously defined using ESX.PlayerFunction. It shows how to retrieve the xPlayer object and then call the custom function ('getName') directly on that object. ```lua --- Usage ---------------------------------- local xPlayer = ESX.GetPlayerFromId(source) local Name = xPlayer.getName() -------------------------------------------- ``` -------------------------------- ### Registering a Simple ESX Command (Heal) Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/infinity/server/command.md Example demonstrating how to register a simple 'heal' command using ESX.Command. It requires 'admin' permissions and calls the player's heal function in the callback. ```lua ESX.Command('heal', 'admin', function(xPlayer, args, show_error) xPlayer.heal() end, false) ``` -------------------------------- ### Example Defining Player Function - ESX - Lua Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/infinity/server/playerfunction.md Provides a practical example of defining a player function named 'getName'. This function is added to the xPlayer object and, when called, returns the player's name using the 'self' argument which references the xPlayer table. ```lua ---- Create Function ----------------------- ESX.PlayerFunction('getName',function(self) return self.name end) -------------------------------------------- ``` -------------------------------- ### Implementing the Cancel Callback Function Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/addons/menu_default/create_menu.md Provides an example of the function executed when a user attempts to close the menu without selecting an element. It demonstrates how to access menu properties like the title and programmatically close the menu. ```Lua funcion(data, menu) print("Closing Menu - " .. menu.title) menu.close() -- close menu end ``` -------------------------------- ### Defining Disabled ESX Context Menu Elements (Lua) Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/addons/esx_context/using_menu.md Shows how to create disabled elements in an ESX context menu by setting the `disabled` property to `true`. Includes examples with and without a description. ```Lua local elements = { { disabled= true, -- Set Element as Disabled icon="fas fa-times", title="Disabled Item", }, { -- disabled Element with a little description underneath the Title disabled=true, icon="fas fa-times", title="Disabled Item", description="Some description here. Add some words to make the text overflow." }, } ``` -------------------------------- ### Getting ESX Player Object by ID - Lua Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/infinity/server/getplayerfromid.md Retrieves an ESX player object based on the provided server ID. Returns nil if the player ID is invalid or the player is not found. ```Lua ESX.GetPlayerFromId(playerId) ``` -------------------------------- ### Handling Element Selection in ESX Context Menu (Lua) Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/addons/esx_context/using_menu.md Provides an example of the `onSelect` callback function, which is triggered when a menu element is clicked. It demonstrates how to access element properties like `title` and `inputValue` and close the menu. ```Lua function onSelect(menu,element) print("Element Selected - ",element.title) --- for a simple element if element.title == "Item A" then print("Item A Selected") ESX.CloseContext() end -- for slider elements if element.name == "textinput1" then print("Name - ".. element.inputValue) end if element.name == "numberinput1" then print("Age - " element.inputValue) end ESX.CloseContext() end ``` -------------------------------- ### Initialize ESX via Export in Lua Script Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/tutorials/tutorials-esx/sharedevent.md Place this line at the start of your client or server Lua script to initialize the ESX object using the export method. This is useful for multi-framework compatibility and prevents race conditions by immediately providing the shared object. ```Lua ESX = exports["es_extended"]:getSharedObject() ``` -------------------------------- ### Build Static Website (Yarn) Source: https://github.com/esx-framework/esx-documentation/blob/main/README.md Generates the static content for the website into the 'build' directory, ready for deployment. ```Shell $ yarn build ``` -------------------------------- ### Deploy Website using SSH (Yarn) Source: https://github.com/esx-framework/esx-documentation/blob/main/README.md Deploys the built website content, specifically configured to use SSH for authentication, often for pushing to a hosting service like GitHub Pages. ```Shell $ USE_SSH=true yarn deploy ``` -------------------------------- ### Defining an HTML Menu Element Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/addons/menu_default/create_menu.md Demonstrates how to create a menu element whose label supports HTML formatting. This allows for custom styling, colors, or other HTML content within the menu item's text. ```Lua -- @Label - String - name to show to user -- @name - String - element identifier -- Element Labels also have HTML support! local Elements = { {label = 'HEY! IM GREEN!/span>', name = "geen_element"} } ``` -------------------------------- ### Defining a Simple Menu Element Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/addons/menu_default/create_menu.md Defines a basic menu element with a visible label for the user and an internal name used for identification when the element is selected. This is the fundamental structure for most menu items. ```Lua -- @Label - String - name to show to user -- @name - String - element identifier local Elements = { {label = "I`m An Element", name = "element1"} } ``` -------------------------------- ### Deploy Website without SSH (Yarn) Source: https://github.com/esx-framework/esx-documentation/blob/main/README.md Deploys the built website content without using SSH, requiring the GitHub username to be provided as an environment variable. Useful for pushing to GitHub Pages. ```Shell $ GIT_USER= yarn deploy ``` -------------------------------- ### Function Signature - ESX.CreateBlip - Lua Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/infinity/client/createblip.md Defines the signature for the ESX.CreateBlip function, showing the required and optional parameters for creating a client-side blip. ```Lua ESX.CreateBlip(name, text, coords, sprite, size, color) ``` -------------------------------- ### Defining Context Menu Elements and Opening in ESX Lua Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/addons/esx_context/using_menu.md This Lua code defines an array of elements for an ESX context menu, including standard items, unselectable items, disabled items, text input, and number input fields. It then opens the context menu using `ESX.OpenContext`, providing callback functions to handle element selection and menu closure, demonstrating how to access selected element data and input values. ```lua local Elements = { { unselectable=true, icon="fas fa-info-circle", title="Unselectable Item", }, { icon="fas fa-check", title="Item A", description="Some description here. Add some words to make the text overflow." }, { disabled=true, icon="fas fa-times", title="Disabled Item", description="Some description here. Add some words to make the text overflow." }, { icon="", -- disable icon title="Input Text", -- Title of text input to show to user input=true, -- Allow input inputType="text", -- set type to Text inputPlaceholder="Name ...", -- PlaceHolder to Show name="textinput1", -- input identifier }, { icon="", -- disable icon title="Input Number", -- Title of number input to show to user input=true, -- allow input inputType="number", -- allow numbers to be inputted inputPlaceholder="Age (0-50)", -- PlaceHolder value inputValue=0, -- default value inputMin=0, -- minimum value inputMax=50, -- maximun value name="numberinput1", -- input identifier }, } ESX.OpenContext("right" , Elements, function(menu,element) -- On Select Function print("Element Selected - ",element.title) --- for a simple element if element.title == "Item A" then print("Item A Selected") ESX.CloseContext() end -- for slider elements if element.name == "textinput1" then print("Name - ".. element.inputValue) end if element.name == "numberinput1" then print("Age - ".. element.inputValue) end ESX.CloseContext() end, function(menu) -- on close print("Menu closed.") print(ESX.DumpTable(menu)) end) ``` -------------------------------- ### Defining Unselectable ESX Context Menu Elements (Lua) Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/addons/esx_context/using_menu.md Illustrates how to define an element that cannot be selected, typically used as a header or label, by setting the `unselectable` property to `true`. ```Lua local elements = { { unselectable= true, icon="fas fa-info-circle", title="Unselectable Item (Header/Label?)", }, } ``` -------------------------------- ### Registering esx_basicneeds:onUse Event Handler (Signature) Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/addons/esx_basicneeds/events/onuse.md This is the basic signature for adding an event handler for the esx_basicneeds:onUse event. It shows the expected parameters passed to the handler function. ```lua AddEventHandler("esx_basicneeds:onUse", type, prop_name) ``` -------------------------------- ### Defining a Slider Menu Element Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/addons/menu_default/create_menu.md Defines a menu element specifically for a slider input. It includes properties for the label, name, default value, type ('slider'), minimum value, and maximum value, allowing users to select a numerical value within a range. ```Lua -- @Label - String - name to show to user -- @name - String - element identifier -- @value - Number - Default value for slider -- @type - string - define the element Type -- @min - Number - Minimum Slider Value -- @max - Number - Maximum Slider Value local Elements = { {label = "Bread - £200", name = "bread", value = 1, type = 'slider', min = 1,max = 100} } ``` -------------------------------- ### ESX Player State Table Layout (Lua) Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/infinity/server/definestate.md This snippet shows the required structure for each state definition within the table passed to ESX.DefineStates. Each state is a key-value pair where the key is the state name and the value is a table specifying the default value, database type, and whether it should be saved. ```Lua ["statename"] = { value = "", -- Default Value (any type) type = "VARCHAR(255)", -- Data Type to Store (string) save = true -- Save to Database (bool) } ``` -------------------------------- ### Handling ESX Context Menu Closure (Lua) Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/addons/esx_context/using_menu.md Shows the `onClose` callback function, which is executed when the context menu is closed. It demonstrates printing a message and dumping the menu table content. ```Lua function onClose(menu) print("Menu closed.") print(ESX.DumpTable(menu)) end ``` -------------------------------- ### Defining Text Input ESX Context Menu Element (Lua) Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/addons/esx_context/using_menu.md Explains how to include a text input field within an ESX context menu element using the `input`, `inputType`, `inputPlaceholder`, and `name` properties. ```Lua local elements = { { icon="", -- disable icon title="Input Text", -- Title of text input to show to user input=true, -- Allow input inputType="text", -- set type to Text inputPlaceholder="Placeholder...", -- PlaceHolder to Show name="textinput1", -- input identifier }, } ``` -------------------------------- ### Configure ESX Import in fxmanifest.lua (Recommended) Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/tutorials/tutorials-esx/sharedevent.md Add this line to your `fxmanifest.lua` or `__resource.lua` file to enable the recommended ESX import method. This automatically syncs ESX data like PlayerData and handles player state changes (relogging, character switching) without needing manual events. ```Lua shared_script '@es_extended/imports.lua' ``` -------------------------------- ### Function Signature - ESX.ToggleBlip - Lua Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/infinity/client/toggleblip.md The function signature for `ESX.ToggleBlip`, showing the required `name` argument. ```lua ESX.ToggleBlip(name) ``` -------------------------------- ### ESX Command Function Signature Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/infinity/server/command.md The basic signature for registering a command using ESX.Command. It takes the command name, required permissions, a callback function, a boolean for console access, and an optional table for chat suggestions. ```lua ESX.Command(name, Permissions, cb, allowConsole, suggestion) ``` -------------------------------- ### Function Signature - ESX.DiscordLog - Lua Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/infinity/server/discordlog.md This snippet shows the signature of the ESX.DiscordLog function, detailing the parameters it accepts for sending messages to a Discord webhook. ```Lua ESX.DiscordLog(name, title, color, message, tag_everyone) ``` -------------------------------- ### Configure NPWD Resource Integration in ESX Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/tutorials/tutorials-esx/npwd.md This JSON snippet shows the configuration required in the ESX framework to enable automatic detection and integration with the NPWD resource. Setting `useResourceIntegration` to `true` is necessary for this feature. ```json "general": { "useResourceIntegration": true, "toggleKey": "f1", "toggleCommand": "phone", "defaultLanguage": "en" }, ``` -------------------------------- ### Defining Player Function Syntax - ESX - Lua Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/infinity/server/playerfunction.md Shows the basic syntax for using ESX.PlayerFunction to define a new function. It requires a name for the function and the function body itself, which receives the xPlayer table as its first argument ('self'). ```lua ESX.PlayerFunction(name , function(self,...)) ``` -------------------------------- ### Defining Number Input ESX Context Menu Element (Lua) Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/addons/esx_context/using_menu.md Shows how to add a number input field to an ESX context menu element, specifying properties like `input`, `inputType`, `inputPlaceholder`, `inputValue`, `inputMin`, `inputMax`, and `name`. ```Lua local elements = { { icon="", -- disable icon title="Input Number", -- Title of number input to show to user input=true, -- allow input inputType="number", -- allow numbers to be inputted inputPlaceholder="Placeholder...", -- PlaceHolder value inputValue=0, -- default value inputMin=0, -- minimum value inputMax=50, -- maximun value name="numberinput1", -- input identifier }, } ``` -------------------------------- ### Deprecated Server ESX Initialization (esx:getSharedObject) Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/tutorials/tutorials-esx/sharedevent.md This snippet shows the old, deprecated server-side method for obtaining the ESX shared object using the `esx:getSharedObject` event. This approach is less efficient than newer methods and is no longer recommended. ```Lua ESX = nil TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) ``` -------------------------------- ### Deprecated Client ESX Initialization (esx:getSharedObject) Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/tutorials/tutorials-esx/sharedevent.md This snippet shows the old, deprecated client-side method for obtaining the ESX shared object using the `esx:getSharedObject` event within a polling loop. This approach is inefficient and no longer recommended due to better alternatives. ```Lua ESX = nil Citizen.CreateThread(function() while ESX == nil do TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) Citizen.Wait(0) end end) ``` -------------------------------- ### Setting Default Spawn Position in ESX Config (Lua) Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/tutorials/tutorials-esx/position.md This snippet shows how to configure the default spawn coordinates and heading directly within the `es_extended` configuration file (specifically line 21). This method is used in ESX versions 1.9.2 and later, replacing the previous database-based setting. ```Lua Config.DefaultSpawn = {x = -269.4, y = -955.3, z = 31.2, heading = 205.8} ``` -------------------------------- ### Registering Server Request Function Signature - ESX - Lua Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/infinity/server/onrequest.md This is the function signature for ESX.OnRequest, used to register a server-side request handler in the ESX framework. It takes a request name (string) and a callback function (function) as arguments. ```Lua ESX.OnRequest(name, cb) ``` -------------------------------- ### ESX DefineStates Function Signature (Lua) Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/infinity/server/definestate.md This is the function signature for ESX.DefineStates, used to define custom data states for players within the ESX framework. It takes a table of state definitions as an argument. ```Lua ESX.DefineStates(states) ``` -------------------------------- ### Resetting Default Position in Users Table (SQL) Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/tutorials/tutorials-esx/position.md This SQL query is necessary for users upgrading from ESX versions older than 1.9.2. It alters the `users` table to remove the default value constraint on the `position` column, allowing the new config-based spawn system to take effect. ```SQL ALTER TABLE `users` ALTER `position` SET DEFAULT NULL; ``` -------------------------------- ### Registering esx_basicneeds:onDrink Event (Deprecated) - Lua Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/addons/esx_basicneeds/events/ondrink.md Registers a handler function for the deprecated esx_basicneeds:onDrink event. This event is no longer recommended for use; the OnUse event should be used instead. The handler function receives the prop name as an argument. ```Lua AddEventHandler("esx_basicneeds:onDrink", prop_name) ``` -------------------------------- ### Handling esx_basicneeds:onEat Event in Lua Source: https://github.com/esx-framework/esx-documentation/blob/main/docs/addons/esx_basicneeds/events/oneat.md This snippet demonstrates how to add an event handler for the esx_basicneeds:onEat event in Lua. Note that this event is deprecated and should not be used in new code. The handler function receives the name of the prop used when eating. ```Lua AddEventHandler("esx_basicneeds:onEat", prop_name) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.