Jump to content

Problem with callRemote and Trace


Cadu12

Recommended Posts

Posted

I made trace with php using Maxmind

  
include("mta_sdk.php"); 
  
$input = mta::getInput(); 
  
$getPlayerTraceInfo = getPlayerTrace($input); // I made the functions, so i cant post full php. 
mta::doReturn( $getPlayerTraceInfo ); 
  

returns [{"ip":"24.24.24.24","country":"United States","city":"Binghamton"}]

  
function result(sum) 
    --outputChatBox(sum["ip"]) 
    outputServerLog(sum["ip"]) 
end 
  
function InfoCityPlayer(ip) 
    callRemote("http://localhost/trace.php", result, ip) 
end 
InfoCityPlayer("24.24.24.24") 
  

returns nil

Posted

from my experience with MTA callRemote, it doesnt like JSON objects like {"Name1":"Value1", "Name2":"Value2"} (they were always nil/empty), only indexed arrays ["Value1", "Value2"] worked fine for me.

Posted

if you do it that way, callback function should be:

function result(ip, country) 
    outputServerLog("IP: "..ip..", country: "..country) 
end 

Posted

To clarify, doReturn expects an array as it is this array that becomes the arguments to the callback function of callRemote. Passing a dictionary/table makes no sense. Of course, the PHP code should tell you this. If someone wants to fix that and upload a new version, feel free.

Posted

Sorry the again offtopic. @Solidsnake14 thats why i dont have any ideas, becuase i am deaf. I have problem with deaf =(

So i can copy ideas :'(

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...