Basic Configuration
This section covers how to configure the basic settings of the Ped Dialog script. By changing config.lua file.
UseInteraction
true/false
You need to decide whether you will use interactions. If you don't need text over the ped's head and don't plan to use key interactions, set this to false
. This way, the script will not start the checking thread, avoiding unnecessary position checks in your situation.
InteractionKey
number
Key to open ped dialog when you use key interaction to open it. You can find all key codes here.
PlayerInvisibleWhileInDialog
boolean
To make a player invisible locally while dialog is open set it to true
. (Other players can still see the player)
PedCam
table
Default camera settings for the ped. These settings will be used if specific camera settings are not defined for the created ped.
offset
- offset calculated from the ped position.fov
- camera FOVpointZOffset
- Z offset ofPointCamAtEntity
Draw3dText
function (text: string, coords: Vector3)
A function to display text over head.
Keep in mind that this function is called every frame don't add any heavy logic here.
Config.Draw3dText = 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
Locales
This one should be easy to understand. The script uses string formatting, and the comments explain what each %s
in the format represents.
Default config
Config = {}
Config.UseInteraction = true
Config.InteractionKey = 38 -- E
Config.PlayerInvisibleWhileInDialog = true
Config.PedCam = {
offset = {
x = 0.0,
y = 2.0,
z = 1.0
},
fov = 50.0,
pointZOffset = 0.0
}
Config.Draw3dText = 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
Locales = {
-- First %s is the ped name, second %s is the ped group
['ped_over_head'] = '%s [~b~%s~w~]',
-- %s ped name
['interact_ped_over_head'] = 'Press ~INPUT_CONTEXT~to interact with ~g~%s~w~',
-- For those who are using custom fonts
['blip_text_component_string'] = '%s',
}
Last updated