Framework Integration
Functions file can be found at configuration/CFunctions.lua
Text Display
Configure how text is displayed when players approach peds. The functions used depend on your Config.UseEveryTickText
setting.
When Config.UseEveryTickText = true
:
The script will use this function to display text when player is close to a ped or when player can interact with ped.
DrawTextEveryTick = function (text, coords)
BeginTextCommandDisplayHelp("STRING")
AddTextComponentSubstringPlayerName(text)
EndTextCommandDisplayHelp(2, false, false, 0)
SetFloatingHelpTextStyle(1, 1, 2, 191, 3, 0)
SetFloatingHelpTextWorldPosition(1, coords.x, coords.y, coords.z + 1.0)
end,
When Config.UseEveryTickText = false
:
The script will use these functions for the same purpose - showing text when player approaches peds and hiding it when they move away. You will need to implement these functions yourself, but this can be done in your own way.
ShowText = function (text, coords)
exports['ox_lib']:showTextUI(text)
end,
HideText = function ()
exports['ox_lib']:hideTextUI()
end,
Example Configuration
CFunctions = {
DrawTextEveryTick = function (text, coords)
BeginTextCommandDisplayHelp("STRING")
AddTextComponentSubstringPlayerName(text)
EndTextCommandDisplayHelp(2, false, false, 0)
SetFloatingHelpTextStyle(1, 1, 2, 191, 3, 0)
SetFloatingHelpTextWorldPosition(1, coords.x, coords.y, coords.z + 1.0)
end,
ShowText = function (text, coords)
-- Add your TextUI implementation
end,
HideText = function ()
-- Add your TextUI hide implementation
end,
}
Last updated