- Ensure the default TCP port in
mtaserver.conf
is set to22005
. - Create a user in the server's admin ACL and add their details to the
.env
file in theNode API
folder (username inMTASAUSER
field, password inMTASAPASS
field). - In the
.env
file in theNode API
folder, set the server's IP address in theMTASAHOST
field and the previously configured TCP port in theMTASAPORT
field.
- To add new commands, go to the
resource
folder and navigate to theconfig
folder. There, you'll find a table containing functions. - Add a new function by placing a comma after the last function and adding its name within square brackets. Create a function with the referenced name inside the brackets, using the ellipsis (
...
) as the main argument to indicate it's a table. - Define the arguments for the new function. For example, to set the time, create a variable taking the hour as the first argument from
args
. UsesetTime(hour, 0)
and return a message. - After adding the function, include it in the API list by going to the
commands.ts
file in thesrc/config
directory. Add a new object inside thecommands
array, specifying ID, NAME, DESCRIPTION, and ARGS.