Advertisement
hhjfdgdfgdfg

vorp input c

Mar 21st, 2024
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. API Docs
  2. Single input
  3. Client Side Only
  4. lua
  5. local button = "Confirm" --label
  6. local placeholder = "Insert player ID" --label
  7.  
  8. TriggerEvent("vorpinputs:getInput", button, placeholder, function(result)
  9.  
  10. if result ~= "" or result then -- making sure its not empty or nil
  11. print(result) -- returs a string
  12. else
  13. print("its empty?") -- notify
  14. end
  15. end)
  16. image
  17.  
  18. With input Type
  19. Client Side Only
  20. lua
  21. local button = "Confirm"
  22. local placeholder = "Test Here"
  23. local inputType = "input" -- number ,textarea , date, etc.
  24. TriggerEvent("vorpinputs:getInput", button, placeholder,inputType, function(result)
  25.  
  26. if result ~= "" or result then -- making sure its not empty or nil
  27. print(result) -- returs a string
  28. else
  29. print("its empty?") -- notify
  30. end
  31. end)
  32. Advanced inputs NEW
  33. Client Side Only
  34. lua
  35. local myInput = {
  36. type = "enableinput", -- don't touch
  37. inputType = "input", -- input type
  38. button = "Confirm", -- button name
  39. placeholder = "NAME QUANTITY", -- placeholder name
  40. style = "block", -- don't touch
  41. attributes = {
  42. inputHeader = "GIVE ITEM", -- header
  43. type = "text", -- inputype text, number,date,textarea ETC
  44. pattern = "[0-9]", -- only numbers "[0-9]" | for letters only "[A-Za-z]+"
  45. title = "numbers only", -- if input doesnt match show this message
  46. style = "border-radius: 10px; background-color: ; border:none;"-- style
  47. }
  48. }
  49.  
  50. TriggerEvent("vorpinputs:advancedInput", json.encode(myInput), function(result)
  51.  
  52. if result ~= "" and result then -- make sure its not empty or nil
  53. print(result) --returns string
  54. else
  55. print("it's empty?") --notify
  56. end
  57. end)
  58. image
  59.  
  60. Devtips
  61. split a string into more than one separated by a space
  62.  
  63. lua
  64. local result = yourvariable
  65. local splitString = {}
  66. for i in string.gmatch(result, "%S+") do
  67. splitString[#splitString + 1] = i
  68. end
  69. local data1, data2 = splitString[1],splitString[2]
  70.  
  71. print(data1,data2)
  72. lua
  73. -- use can use these to make sure what you want the input to be.
  74. tostring(data1) -- returns string
  75. tonumber(data2) -- returns number
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement