3ventic Posted May 25, 2012 Posted May 25, 2012 I'm trying to use the MTA PHP API to establish a connection to get data from the MTA server. When call() (or callfunction()) is used, it throws HTTP error 401 (Access denied), and on the MTA server console, it says HTTP: 'mta' entered correct password from [iP] $mtaQ = new mta('128.204.203.182', 22005, 'mta', [correct password here]); $resource = $mtaQ->getResource('CheckQuery'); // Exists and is running on the MTA server. $mtaInfo_str[] = $resource->call('getPlayerInfo'); // Is an exported server-side function within CheckQuery The script is on the same IP (and VPS) with the server and I've been trying a bunch of other ways to do it (using $mtaInfo_str as non-array, calling with callfunction() instead of call, leaving login info out, etc.), but it seems I've run into a dead end. Any help?
Anderl Posted May 25, 2012 Posted May 25, 2012 Are the username and password correct? "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
3ventic Posted May 26, 2012 Author Posted May 26, 2012 Username and password are correct and the MTA server account has the same pass and user as the FTP used.
AeroXbird Posted May 26, 2012 Posted May 26, 2012 Perhaps because the resource name is case sensitive and you made a typo?
3ventic Posted May 26, 2012 Author Posted May 26, 2012 The name of the resource matches the folder name and meta.xml.
50p Posted May 27, 2012 Posted May 27, 2012 Make sure your function is exported as an http function. - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
3ventic Posted May 27, 2012 Author Posted May 27, 2012 Make sure your function is exported as an http function. Fixed it, thanks.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now