Very simple question about this line

Hello guys, very simple question, over here it says Text = 'Press ~INPUT_CONTEXT~ to enter ~y~house~s~.',

My question is where **INPUT_CONTEXT****is, is that where I put the key they need to press?

For example Text = 'Press ~E~ to enter ~y~house~s~.', would that work?

This indicates the control name of a key as seen here Controls - Cfx.re Docs

Your example probably displays a help message on the top left or an instructional button on the bottom right. When using ~INPUT_CONTEXT~ it would show an E button.

Your second text will work but it will not show a button. It will literally say Press ~E~ to enter house. (with house in yellow).

Thanks for the fast reply. Here is what I am using it for, a simple teleport script How about this?

Config              = {}

Config.DrawDistance = 100.0

Config.Marker = {
	Type = 1,
	x = 1.5, y = 1.5, z = 1.0,
	r = 255, g = 55, b = 55
}

Config.Pads = {

	TheLostHouseIn = {
		Text = 'Press ~r~E~w~ to enter ~y~house~s~.',
		Marker = { x = -1112.02, y = 4936.51, z = 218.39 },
		TeleportPoint = { x = 998.4809, y = -3164.711, z = -38.90733, h = 0.87 }
	},

	TheLostHouseOut = {
		Text = 'Press ~r~E~w~ to leave the ~y~house~s~.',
		Marker = { x = 998.4809, y = -3164.711, z = -38.90733 },
		TeleportPoint = { x = 1400.25, y = 1123.59, z = 114.84, h = 180.0 }
	}

}

Issue I am having is when i walk to the marker its there, but it doesnt teleport me or give me an option to press any button, even if I press E, so I just changed it to what you’re seeing now and hoping I did it righht.

It looks fine but this is just an array of a configuration file it seems. There’s not actually any code in this.

1 Like

Thanks once again, this is esx_teleportpads that I’ve randomly ran across, I dont know how to make my own teleporting script yet, I’ve heard its fairly easy to make but I am trying to find documentation on how to do it, so I am having to resort to this for now

Here is whats in the client.lua

local HasAlreadyEnteredMarker = false
local LastPad                 = nil
local LastAction              = nil
local LastPadData             = nil
local CurrentAction           = nil
local CurrentActionMsg        = ''
local CurrentActionData       = nil
local ClickedInsideMarker     = false

ESX                           = nil

Citizen.CreateThread(function()
	while ESX == nil do
		TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
		Citizen.Wait(0)
	end
end)

RegisterNetEvent('esx_teleportpads:hasEnteredMarker')
AddEventHandler('esx_teleportpads:hasEnteredMarker', function(currentPad, padData)
	CurrentAction = 'pad.' .. string.lower(currentPad)
	CurrentActionMsg = padData.Text
	CurrentActionData = { padData = padData }
end)

RegisterNetEvent('esx_teleportpads:hasExitedMarker')
AddEventHandler('esx_teleportpads:hasExitedMarker', function()
	ESX.UI.Menu.CloseAll()
	
	CurrentAction = nil
	ClickedInsideMarker = false
end)

-- Draw marker
Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)
		
		local playerPed = PlayerPedId()
		local coords = GetEntityCoords(playerPed)

		for pad, padData in pairs(Config.Pads) do
			if GetDistanceBetweenCoords(coords, padData.Marker.x, padData.Marker.y, padData.Marker.z,  true) < Config.DrawDistance then
				DrawMarker(Config.Marker.Type, padData.Marker.x, padData.Marker.y, padData.Marker.z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.Marker.x, Config.Marker.y, Config.Marker.z, Config.Marker.r, Config.Marker.g, Config.Marker.b, 100, false, true, 2, false, false, false, false)
			end
		end
	end
end)

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)
		
		local playerPed      = PlayerPedId()
		local coords         = GetEntityCoords(playerPed)
		local isInMarker, currentPad, currentAction, currentPadData = false, nil, nil, nil

		for pad,padData in pairs(Config.Pads) do
			if GetDistanceBetweenCoords(coords, padData.Marker.x, padData.Marker.y, padData.Marker.z, true) < (Config.Marker.x * 1.5) then
				isInMarker, currentPad, currentAction, currentPadData = true, pad, 'pad.' .. string.lower(pad), padData
			end
		end

		local hasExited = false

		if isInMarker and not HasAlreadyEnteredMarker or (isInMarker and (LastPad ~= currentPad or LastAction ~= currentAction)) then
			if (LastPad ~= nil and LastAction ~= nil) and (LastPad ~= currentPad or LastAction ~= currentAction) then
				TriggerEvent('esx_teleportpads:hasExitedMarker', LastPad, LastAction)
				
				hasExited = true
			end

			HasAlreadyEnteredMarker = true
			LastPad, LastAction, LastPadData = currentPad, currentAction, currentPadData

			TriggerEvent('esx_teleportpads:hasEnteredMarker', currentPad, currentPadData)
		end

		if not hasExited and not isInMarker and HasAlreadyEnteredMarker then
			HasAlreadyEnteredMarker = false

			TriggerEvent('esx_teleportpads:hasExitedMarker', LastPad, LastAction)
		end
	end
end)

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(10)

		if CurrentAction ~= nil then

			ESX.ShowHelpNotification(CurrentActionMsg)

			if IsControlJustReleased(0, Keys['E']) then
				if ClickedInsideMarker == false then
					ClickedInsideMarker = true

					ESX.Game.Teleport(PlayerPedId(), CurrentActionData.padData.TeleportPoint, function()
						SetEntityHeading(PlayerPedId(), CurrentActionData.padData.TeleportPoint.h)
					end)
				end
			end
		else
			Citizen.Wait(500)
		end
	end
end)

Got it to work btw! Its written correctly, thanks for double checking with me @d0p3t :grinning:

hey i have a question ,your esx_teleportpads able to teleport with car