I’m looking into the possibility to link my FiveM server up with my website in order to send data, receive data and process that data. I’m experienced in web development, and i’m rather more experienced in FiveM Lua however I haven’t been able to make a link between the two, could somebody possibly give me a hand?
I’m assuming it would be a matter of sending data via POST or GET and processing said data in PHP, inserting into sql or whatever I may need? I just don’t know how i’d do so, thank you for reading.
[SOLVED]
Thanks to someone that commented, I ended up setting up an SQL database with a WAMP server rather easily and connecting to it from my webserver.
Ok cause player info you can get without hassle. There’s many ways you could do this. I’d use some html in the server scripts then from html send it to PHP etc. If it’s something you wanna log SQL would be the go for that. Just write it to SQL then retrieve.
Thank you. I understand this is the method so to speak, but my question is more in regards to the execution of the method. Any examples, tutorials, anything really would be helpful. Sorry if I wasn’t completely clear in the original question
Let’s say for example, I want to get an ETA from Point B to Point A. What i’d do is calculate time from speed and distance and assign it to a variable. Now, what I want to do is get that time in the variable and display it on a web page.
What I need to know is how do I actually do this? How do I get the variable from Server to Webserver? Or if it’s easier for everyone, how do I INERT into a MySQL database on the webserver from the game server.
Yeah, tried that but with no direction at all as to what exactly i’m doing, it’s difficult to be able to understand what has been done to achieve it. If anyone has anything that could help me achieve my goal, i’d be much appreciated. I have no clue what i’m doing in regards to websockets or anything
Javascript / NodeJS or PHP usually whatever language you are running your website with or whatever…
I am really not sure what “resources” you are looking for. Learning a language could take a LOT of hours just to learn the language by reading documents or watching videos with the exception you are practicing as you learn… Things you can do with the language usually come after you can write the language…
I can write PHP, SQL, Lua and have an understanding of them all aswell as more on top of that. I have a decent enough understanding, all I need is some guidance as to how to go about achieving my goal. Any APIs out there already, ready to use… Any guides on how to do this. I’ve seen a few times something about PerformHttpRequest, but don’t know how this is used. I’m not after a 3 week course on Lua and PHP, i simply want guidance. A helping hand.
Well I dont know PHP you will have to do some digging to figure that out. As far as communicating woth an API the only way is to use an HTTP GET OR POST request
So far, i’ve done as much research as I can at 4am, and have managed to use performhttprequest to send the chat data to a discord server via a webhook. But now i’ve done that, what’s required of me to do exactly the same except sending the data to a webserver instead and storing it somewhere. I understand this is the FiveM forums, however this question will require some assistance with PHP.
I believe the data is being sent from the FiveM server to the Webserver (Nowhere near certain) but there’s no way I can think of to prove this because I have no idea how to then display that data.
But if i’m correct, would this have to be done with AJAX or something due to the fact the page isn’t constantly updating. At the moment, if I do that after sending the data over and refresh the web page it does absolutely nothing which is to be expected I suppose.