You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can access the MTA Web Interface from almost any programming language that can request web pages. PHP can do this very easily.
4
5
5
6
This SDK provides one function call that will allow you to call any exported script functions on any server that you have access to.
6
7
7
8
See the [official wiki page](https://wiki.multitheftauto.com/wiki/PHP_SDK) for further information.
9
+
10
+
## Installation
11
+
12
+
### Prerequisites
13
+
14
+
This SDK require PHP 7.1 or greater
15
+
16
+
### Setup
17
+
18
+
The only supported installation method is via [Composer](https://getcomposer.org). Run the following command to require this SDK in your project:
19
+
20
+
```
21
+
composer require multitheftauto/mtasa-php-sdk
22
+
```
23
+
24
+
### HTTPlug client abstraction
25
+
26
+
As this SDK use HTTPlug, you will have to require some libraries for get it working. See at [HTTPlug for library users](http://docs.php-http.org/en/latest/httplug/users.html).
27
+
## A simple example
28
+
29
+
```php
30
+
<?php
31
+
32
+
require_once('vendor/autoload.php');
33
+
34
+
use MultiTheftAuto\Sdk\Mta;
35
+
use MultiTheftAuto\Sdk\Model\Server;
36
+
use MultiTheftAuto\Sdk\Authentication\Credential;
37
+
38
+
$server = new Server('127.0.0.1', 22005);
39
+
$credential = new Credential('myUser', 'myPassword');
0 commit comments