[Standalone] TP-Inputs

TP-Inputs allows you to create a Text Field input, Multiple Options Input and Buttons Selection Inputs which both return the selected / typed value.

Fully responsive to all screen resolutions.

How to use Buttons Selection?

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

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.

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.

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.

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)

This script will be an extra semi-requirement for my free or paid scripts and also can be used for anyone who is interested.

Github: https://github.com/TitansProductions/TP-Inputs

2 Likes

Updated to version 1.1.0

New feature added for getting the returned clicked values.

How to use Buttons Selection with returned values?

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

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) 

Updated to version 1.2.0

New feature added for adding and getting the returned option values.

1 Like