overextended / ox_lib

A FiveM resource and script library for Lua and JS.
https://overextended.dev/ox_lib
GNU Lesser General Public License v3.0
282 stars 378 forks source link

feat(addCommand): longString #597

Closed BerkieBb closed 4 days ago

BerkieBb commented 2 weeks ago

Whenever you have a command that has a text type at the end where you want to catch all text from that argument and on, only the first word will be assigned to that argument and the rest ends up all in an array which makes for a mixed table. With longString it catches those extras if the argument is at the end of the given params.

For example /test test1 test2

Before only test1 would be shown. After, all text will be shown.

I haven't tested this yet but ChatGPT said it will work fine

BerkieBb commented 1 week ago

Raw string now used

thelindat commented 1 week ago

To clarify, there's no need to split the string into many parts and concatenate or join strings together. Just get the position of the last argument in the raw string and then make a substring from that point.

BerkieBb commented 1 week ago

Changed