Jump to content

mta sdk


botshara

Recommended Posts

Hello, I have a problem with MTA SDK, i disabled mta httpserver

0

and make it download from url myip/resources , all works fine, but from website cant connect to server (user doesnt connect to server, nothing in server logs showing)

I also changed port in my php script to 80, but nothing

Link to comment
Why did you change the port to 80? Why did you disable the httpserver? What sdk are you using (php, javascript)? did it work before?

Because 80 port is default for my apache, I disabled it because need download from my apache http server not from mta httpserver on the basis mta httpserver lagging my server.

Im using php mta SDK

Link to comment

Are you sure you're still using the right information while trying to connect? The wiki has this as an example;

include( "mta_sdk.php" ); 
$mtaServer = new mta("example.com", 33004, "myUsername", "myPassword" ); 
$mtaServer->getResource("someResource")->call("someFunction"); 

Link to comment
  
        function myFunction($charactername, $hours) { 
        if($hours >= -1) { 
        $MY_SERVER = [ 
            "host" => "89.53.89.145/resources",        #The host/IP of your MTA server 
            "http_port" => 80,         #The HTTP port for your MTA server (Default 22005) 
            "http_user" => "mta_php_sdk", #The username that we created in the previous step 
            "http_pass" => "xxxxxx"     #The password for the username that we created 
        ];   
        $SERVER = new mta ( $MY_SERVER['host'], $MY_SERVER['http_port'], $MY_SERVER['http_user'], $MY_SERVER['http_pass'] );     
            $RESOURCE = $SERVER->getResource ( "mta_php" );        
            $RESOURCE->call ( "myFunction", $charactername ); 
  
  

All worked fine, when was 22005 port and when was enabled mta http server. But now doesnt connect to server, because doesnt showing that user is trying to logging (in console)

Link to comment

The problem is with your "host" => "89.53.89.145/resources", your host is still "89.53.89.145", take out that "/resources". The location of your resources is indeed at that location, but that doesn't mean that every player is going to connect to the server "89.53.89.145/resources". It's connecting to the server "89.53.89.145". (:

Also, change the port to the port which your server is still using, most likely 22003 or 22005. Not sure which port the script most likely uses. Guess it's 22005 since that's the http port.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...