sFxMTA Posted June 4, 2018 Share Posted June 4, 2018 (edited) 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 June 4, 2018 by XisH Link to comment
sFxMTA Posted June 5, 2018 Author Share Posted June 5, 2018 UP, please i need to know what i'm missing... Link to comment
Skream Posted June 5, 2018 Share Posted June 5, 2018 I think you can't do it with callRemote. try fetchRemote https://wiki.multitheftauto.com/wiki/FetchRemote Link to comment
sFxMTA Posted June 6, 2018 Author Share Posted June 6, 2018 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
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