I’m no developer, I’m just muddling through blindly trying to alter resources others have made. Currently, I alter a script, shut down the server via ZAP control panel(waiting for it to process), upload the script in an FTP client, start the server via ZAP control panel(waiting for it to process), start the FiveM client, direct connect(waiting for it to connect) test the resource to find that I didn’t do something correctly, Then I will start the process over again.
I’ve done this over 100 times in a day.
I’ve got a lot of questions:
Is there a way to reload a resource on a running server without the whole restart process being necessary?
Can I have a development server on the local network(I have both Win and Lin on the network)?
Can I copy the entire server files over to my local server and just change the license in server.cfg or do I need to just move the resources and db and try to simulate the live server?
Any help would be greatly appreciated, I’m failing miserably at trying to alter these resources and it would help a lot to quicken the failure process.
First off, that is pretty much the process for a lot of scripts.
For some resources, you can use the following command in the server console:
restart resourcenamehere
Which restarts the resource, and you can test your changes. For some resources that are dependent on others, this might not work - and you’ll have to restart the server completely (or your client).
Either way, as long as you have the correct server binaries for windows/linux (whichever you’re using).
It would be best to use a separate db for your dev server so you’re not interfering with the live one.
The answer is yes and no lol
So let’s say you wanted to add a new resource to the server and not restart it. You would have to
upload all files to your FTP of choice.
Then you would have to add the start entry in the Server CFG for the resource.
Now you will need to be in game and set to super admin
Type /refresh in local chat you will see a message pop up confirming the new found resource.
Now type /start Resource Name and the resource will start
I have noticed a few things can happen tho lets say your adding some thing to ESX the menu or a new ESX feature, only some things may function like a menu with nothing in it until you restart the server. Since most all ESX stuff has to communicate with the database or other resources you will need a clean cache and a good old reboot.
Any thing that reads a mysql database you will need to restart the server for it to work.
But lets say adding or working on standalone mods like cars peds new scripts all no issues.
Now once you added a resource by typing refresh and starting the resource by command. You may now use the restart resource command. This comes in uber handy when working on HUDs on screen moving them around and what not. Because all you need to do is edit upload and type in local chat /restart Resource name.
Commands that i know of
/refresh
/start resource name
/restart resource name
/stop resource name [Super handy for debugging the xbox controller]
Thank you all so much for your help! I’ve managed to get a development server running on the local network and have begun working with it. It’s so much easier than dealing with a remote server.
I see a lot on the server side in the terminal than I do on the client, which makes sense. Do you happen to know if there’s a page in the wiki or elsewhere that goes through a complete list of commands to be given in both the server and client console? I understand resources will add their own, I’m just looking for core commands that can be passed.
Finding FiveM Commands at first is like trying to find a needle in a hay stack.
Iv always check google and the normal sources. Im sure there is alot more out there some wheres but heres
what i have saved.