Note
جهة الكلاينت
المدخلات جزء من jrs_core، وما تحتاج ريسورس إضافي.
advancedInput#
ينشئ قائمة مدخلات متقدمة وينتظر لين اللاعب يأكد أو يسكّرها.
local myInput = {
type = "enableinput", -- don't touch
inputType = "input", -- input type
button = "Confirm", -- button name
placeholder = "NAME QUANTITY", -- placeholder name
style = "block", -- don't touch
attributes = {
inputHeader = "GIVE ITEM", -- header
type = "text", -- input type: text, number, date, textarea ETC
pattern = "[0-9]", -- only numbers "[0-9]" | letters only "[A-Za-z]+"
title = "numbers only", -- shown if the input doesn't match
style = "border-radius: 10px; background-color: ; border:none;" -- style
}
}
local result = exports.jrs_core:advancedInput(myInput)
result = tonumber(result) -- convert result to a number
result = tostring(result) -- convert result to a stringإذا تبي تقسّم النتيجة لمتغيرين أو أكثر تقدر تستخدم هذا الكود:
local result = "your result"
local splitString = {}
for i in string.gmatch(result, "%S+") do
splitString[#splitString + 1] = i
end
local data1, data2 = splitString[1], splitString[2]