diff options
Diffstat (limited to 'DOCS/man/lua.rst')
-rw-r--r-- | DOCS/man/lua.rst | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/DOCS/man/lua.rst b/DOCS/man/lua.rst index 0dbd7d3c0a..dab185a284 100644 --- a/DOCS/man/lua.rst +++ b/DOCS/man/lua.rst @@ -109,7 +109,17 @@ The ``mp`` module is preloaded, although it can be loaded manually with ``mp.command_native(table [,def])`` Similar to ``mp.commandv``, but pass the argument list as table. This has the advantage that in at least some cases, arguments can be passed as - native types. + native types. It also allows you to use named argument. + + If the table is an array, each array item is like an argument in + ``mp.commandv()`` (but can be a native type instead of a string). + + If the table contains string keys, it's interpreted as command with named + arguments. This requires at least an entry with the key ``name`` to be + present, which must be a string, and contains the command name. The special + entry ``_flags`` is optional, and if present, must be an array of + `Input Command Prefixes`_ to apply. All other entries are interpreted as + arguments. Returns a result table on success (usually empty), or ``def, error`` on error. ``def`` is the second parameter provided to the function, and is |