Difference between revisions of "CommandArgumentType"
From Nomad DB
(Created page with "Arguments to Console Commands can be parsed and validated before the callback is called. Providing a ''CommandArgumentType'' to ICommand...") |
|||
Line 11: | Line 11: | ||
| No validation is performed | | No validation is performed | ||
|- | |- | ||
− | | '''CommandArgumentType.Int32 | + | | '''CommandArgumentType.Int32''' |
− | CommandArgumentType.UInt32''' | + | '''CommandArgumentType.UInt32''' |
| number | | number | ||
| The argument is parsed as a 32-bit integer. If UInt32 is specified, no negative values can be supplied. | | The argument is parsed as a 32-bit integer. If UInt32 is specified, no negative values can be supplied. | ||
|- | |- | ||
− | | '''CommandArgumentType.Int64 | + | | '''CommandArgumentType.Int64''' |
− | CommandArgumentType.UInt64''' | + | '''CommandArgumentType.UInt64''' |
| string | | string | ||
| The argument is parsed as a 64-bit integer. If UInt64 is specified, no negative values can be supplied. Since Lua 5.1 cannot handle 64-bit Integers, this will be passed as string, | | The argument is parsed as a 64-bit integer. If UInt64 is specified, no negative values can be supplied. Since Lua 5.1 cannot handle 64-bit Integers, this will be passed as string, | ||
Line 25: | Line 25: | ||
| The argument is parsed as decimal value. | | The argument is parsed as decimal value. | ||
|} | |} | ||
+ | |||
+ | == Related Pages == | ||
+ | * [[ICommandRegistry]] | ||
+ | * [[WD2 ScriptHook: Console Commands]] | ||
+ | |||
+ | [[Category:WD2 ScriptHook Lua]] |
Revision as of 11:53, 15 April 2020
Arguments to Console Commands can be parsed and validated before the callback is called. Providing a CommandArgumentType to ICommandRegistry:AddArgument is optional (no validation will be done).
Types
Name | Lua Type | Description |
---|---|---|
CommandArgumentType.Any | string | No validation is performed |
CommandArgumentType.Int32
CommandArgumentType.UInt32 |
number | The argument is parsed as a 32-bit integer. If UInt32 is specified, no negative values can be supplied. |
CommandArgumentType.Int64
CommandArgumentType.UInt64 |
string | The argument is parsed as a 64-bit integer. If UInt64 is specified, no negative values can be supplied. Since Lua 5.1 cannot handle 64-bit Integers, this will be passed as string, |
CommandArgumentType.Float | number | The argument is parsed as decimal value. |