Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

mtasdk-reloaded

A simple SDK for MTA:SA webadmin requests made in Node.js

mta, mtasa, sa, san, andreas, request, webadmin, sdk, videogame, grand, theft, auto

readme

MTASDK

This package is a reloaded version! show original

A module to facilitate calling http exported functions from MTA:SA servers.

Installation

const MTA = require('mtasdk-reloaded');

Usage

MTA Class

The module exports a class, the MTA class. Instantiating the class requires you to specify a host and port to the MTA:SA server.

Syntax:

MTA(host='localhost', port=22005, username='', password='') // Contrustor
MTA.prototype.call(resource_name, function_name, arguments={})

Example

const MTA = require('mtasdk-reloaded');

var myserver = new MTA(); // Connect to http://localhost:22005
myserver.call('resource', 'exportedFunction', ['arg1', 'arg2', 5, ['table']]);

Other Example

const MTA = require('mtasdk-reloaded');

var myserver = new MTA(); // Connect to http://localhost:22005
myserver.getAllGroups(function(err, data) {
  console.log(err + data)/
})