General > Developers Corner

ULX Commands

<< < (5/6) > >>

Aaron113:

--- Quote from: Megiddo on November 09, 2010, 08:48:52 PM ---vote:addParam{ type=ULib.cmds.StringArg, hint="options", ULib.cmds.takeRestOfLine, repeat_min=2, repeat_max=10 }

--- End quote ---

I was talking about this portion.  I wouldn't want to create 10 extra arguments and check to see if a value was entered for each one.

Megiddo:

--- Quote from: Aaron113 on March 15, 2011, 05:49:10 AM ---I was talking about this portion.  I wouldn't want to create 10 extra arguments and check to see if a value was entered for each one.

--- End quote ---

I'm not sure what you mean

JamminR:
Aaron, even I have to admit, I'm a bit confused at what you're asking, and I'm normally pretty good at seeing the root question my team members miss.
Do you mean you set up the first one or two argument checks, then want a table of anything else typed in that you didn't account for?
Thats what the "takerestofline" bit is for. It's not a table, its a string, but if you think you'll really need it as a table, it can be converted using any normal string to table means.
http://ulyssesmod.net/docs/files/lua/ulib/shared/commands-lua.html#cmds.takeRestOfLine

Aaron113:
Instead of doing this...

--- Code: ---function ulx.whatever( ply, string1, string2, string3, string4, string5, string6, string7, string8, string9, string10 )

--- End code ---

Would it be possible to make it...

--- Code: ---function ulx.whatever( ply, tableOfStrings )
--- End code ---

Because I've only been able to do the first one.  I can't figure out any other way.

Megiddo:
As JamminR said, use cmds.takeRestOfLine. If you'd like to split it into a table, use ULib.splitArgs

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version