Jump to content

Call remote


Karoffe

Recommended Posts

I have 2 questions

First one can I connect to a URL which should return a xml file(or a string and I create the XML file myself) ?

something like this

function testFunction(result) 
    outputChatBox(result) 
end 
setTimer(function() 
    local test = callRemote ( "https://yts.re/api/upcoming.xml", testFunction) 
    if not test then 
        outputChatBox("failed") 
    else 
        outputChatBox("succeed") 
end 
end, 2000, 1) 

the URL which I want to connect is this

https://yts.re/api/upcoming.xml

^ That's just an example..

If I used callRemote on this URL what should return instead of "ERROR" ?

And how to make it return an XML file or a string and I create the XML file myself ?

2nd Question

Is there a way in LUA to connect to API of websites (without the callRemote) ? I am going to use this outside MTA so I need to find a way.

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