odd_create_command¶
Syntax¶
odd_create_command(name, arg_array)
Parameters¶
| Name | Description |
|---|---|
| name | The name of the command or function to create. |
| arg_array | An array of Values acting as the arguments to the command. |
Returns¶
Command: The reference to the new Command. There is no need to free or delete it, because of how it is handled internally.
Description¶
This function creates a new Command, initializing it with the given parameters.
Note
If you’re looking to make a command or function to use in-game, instead use odd_instance_function_add or odd_instance_command_add.
Example¶
var args;
args[0] = odd_create_value(odd_type_int32, 9);
args[1] = odd_create_value(odd_type_int32, 10);
var command = odd_create_command("add", args);
// ...
This would create a new Command with the name “add”, that has 2 int32 arguments, 9 and 10.