> For the complete documentation index, see [llms.txt](https://titans-productions.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://titans-productions.gitbook.io/documentation/redm/utility-scripts/tp-inputs.md).

# TP Inputs

### **How to disable specific key actions when using the TP Inputs?**

Go to `tp_inputs/client.lua` file and search the thread (**Citizen.CreateThread**) that is used by searching `DisableControlAction` , in there, you will find all the key shortcuts that are already disabled by default, including the horse and the wagon whistling.

<figure><img src="https://1388375997-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY2RtqVuE0tQRiqtUiG9D%2Fuploads%2Ft4AyokK3XJqE2W4Xx9JM%2Fimage.png?alt=media&amp;token=d945e79b-9695-4f3b-8d46-cc449ca074e3" alt=""><figcaption></figcaption></figure>

### **How to use Buttons Selection?**

When clicking a button, it will return `ACCEPT` or `DECLINE` values as a String.

```lua
local inputData = {
    title = "Your title",
    desc = "Your description",
    buttonparam1 = "ACCEPT",
    buttonparam2 = "DECLINE"
}
                            
TriggerEvent("tp_inputs:getButtonInput", inputData, function(cb)

    if cb == "ACCEPT" then
        -- do action
    end
end) 
```

### **How to use Buttons Selection with returned values?**

When clicking a button, it will return BUY or SELL values as a String.

```lua
local inputData = {
    title = "Your title",
    desc = "Your description",
    buttonparam1 = "BUY",
    buttonparam2 = "SELL"
}
                            
TriggerEvent("tp_inputs:getButtonReturnedValuesInput", inputData, function(cb)

    if cb == "BUY" then
        -- do action
    end
end) 
```

### **How to use Text Inputs?**

When clicking `ACCEPT` button, it will return the input text value as a String.

```lua
local inputData = {
    title = "Your title",
    desc = "Your description",
    buttonparam1 = "ACCEPT",
    buttonparam2 = "DECLINE"
}
                            
TriggerEvent("tp_inputs:getTextInput", inputData, function(cb)

    if cb == "TEST" then
        -- do action
    end
end) 
```

### **How to use Multiple Option Inputs?**

When clicking ACCEPT button, it will return the selected option text value as a String.

```lua
local inputData = {
    title = "License Registration",
	desc  = "What license registration type would you like to create?",
	buttonparam1 = "ACCEPT",
	buttonparam2 = "DECLINE",

	options = {} -- <- The list with the name values.
}
	
TriggerEvent("tp_inputs:getSelectedOptionsInput", inputData, function(cb)
	if cb == "something" then
          -- do action
	end
			
end)
```

### **How to use a slider?**

When clicking ACCEPT button, it will return the selected option text value as a String.

```lua
local inputData = {
    title = "Insert Quantity",
	desc  = "how much quantity would you like to withdraw?",
	buttonparam1 = "ACCEPT",
	buttonparam2 = "DECLINE",
	min          = 1, -- <- minimum quantity
	max          = 20, -- <- maximum quantity
}
	
TriggerEvent("tp_inputs:getSliderResult", inputData, function(cb)
	if cb ~= "DECLINE" then
          -- do action (returns an integer)
	end
			
end)
```

### **How to use an advanced slider?**

When clicking ACCEPT button, it will return the selected option text value as a String.

```lua
local inputData = {
    title            = "Insert Quantity",
	desc             = "how much quantity would you like to withdraw?",
	buttonparam1     = "ACCEPT",
	buttonparam2     = "DECLINE",
	min              = 1, -- <- minimum quantity,
	max              = 20, -- <- maximum quantity,
    cost             = 0.10, -- <- item cost x1
    cost_description = "you will pay: ",
    cost_currency    = " dollars,
}
	
TriggerEvent("tp_inputs:getAdvancedSliderResult", inputData, function(cb)
	if cb ~= "DECLINE" then
          -- do action (returns an integer)
	end
			
end)
```
