Jump to content

Problem with PHP SDK


mehmetejr

Recommended Posts

Hi there. I have a UCP and I wanna connect SDK with it but whenever I enter credientals, I take this error (btw I am not sure how to fill SDK credientals , I need help about it as well )


Fatal error: Uncaught exception 'Exception' with message 'There was a problem with the request. Ensure that the resource exists and that the name is spelled correctly.' in C:\xampp\htdocs\classes\mta_sdk.php:171 Stack trace: #0 C:\xampp\htdocs\classes\mta_sdk.php(74): mta->do_post_request('188.165.168.148', '22005', '/classes/call/_...', '') #1 C:\xampp\htdocs\classes\mta_sdk.php(225): mta->callFunction('classes', '_getPlayerCount', Array) #2 C:\xampp\htdocs\footer.php(5): Resource->call('_getPlayerCount') #3 C:\xampp\htdocs\ucp.php(12): include('C:\\xampp\\htdocs...') #4 {main} thrown in C:\xampp\htdocs\classes\mta_sdk.php on line 171

 

 

 

Link to comment

This exception is thrown when the MTA's server HTTP agent returns a 404 error. This means either the resource 'classes' or the function '_getPlayerCount' doesn't exist on the server. This function is called from line 5 of footer.php which is included on line 12 of ucp.php.

Link to comment
5 hours ago, MrTasty said:

This exception is thrown when the MTA's server HTTP agent returns a 404 error. This means either the resource 'classes' or the function '_getPlayerCount' doesn't exist on the server. This function is called from line 5 of footer.php which is included on line 12 of ucp.php.

well when I change the 22005 port, I don't get any errors but I cannot make connection between server and ucp...

Edited by mehmetejr
Link to comment

You don't get errors because connection failed ≠ error 404. If you're getting a 404 error (or the 'There was a problem with the request. Ensure that the resource exists and that the name is spelled correctly.' exception), it means you're connecting to a proper HTTP server (and likely the one you want to connect to).

Are you sure there is a resource called 'classes' running on the server, and that it has a function called '_getPlayerCount' and that it is indeed exported for HTTP use in meta.xml?

Link to comment
10 minutes ago, MrTasty said:

You don't get errors because connection failed ≠ error 404. If you're getting a 404 error (or the 'There was a problem with the request. Ensure that the resource exists and that the name is spelled correctly.' exception), it means you're connecting to a proper HTTP server (and likely the one you want to connect to).

Are you sure there is a resource called 'classes' running on the server, and that it has a function called '_getPlayerCount' and that it is indeed exported for HTTP use in meta.xml?

There is a resource in the server named " usercontrolpanel ".

Actually, I made the connection between servers but the problem is that I cannot click transfer icon when I change port to 80...

 

Edited by mehmetejr
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...