Jump to content

[HELP] callRemote problem


sFxMTA

Recommended Posts

Hello guys, i never used callRemote before and i'm trying to understand it, so i did a example script but it returns always nil and i don't know where's the real problem...
I'll leave off the details here

PHP File: 

<?php 
  
require 'sdk/mta_sdk.php'; 
mta::doReturn("Hi"); 
?> 

 

Lua: 

function Callcallback() 
	callRemote("website/page.php",call2) --I just removed the website here but i've put my php page of course
end 

addEvent("CallRemoteTry",true) 
addEventHandler("CallRemoteTry",getRootElement(),Callcallback) 

function call2(res)
	outputDebugString(toJSON({res})) 
	if res ~= "ERROR" then
		outputDebugString("Try.") 
	else
		outputDebugString("Try2.") 
	end
end

It gives "Try" with a nil value...

What am i doing wrong? Please help me finding out this...

Edited by XisH
Link to comment

I tried with fetchRemote, then i found that even with callRemote was working, the php file was empty, my Notepad++ didn't saved the file even if it seemed to be saved...

Sorry for bothering and thanks for your answer :)

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