Setting Up a FiveM Dev Server (Zero to Hero Episode 1)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone and welcome to my zero to hero 5m development tutorial in lua uh this is the very first episode and the goal with this tutorial series is to get you started creating 5m resources and scripts uh and then in later episodes we'll dive into some more advanced techniques and just things that are good to know neat features that i've found um and just kind of how to level up as a developer so coming into this tutorial series it does uh expect that you have a little bit of working knowledge about programming it's something that you're somewhat familiar with you certainly don't need to be an expert in anything but some familiarity with programming paradigms and practices is good to know as well as maybe some familiarity with lua fortunately lou is a really simple language to learn i'm a really big fan of lua so you shouldn't have too hard of a time picking it up at all to kick things off just to share a little bit about myself i'm a professional software engineer i've been working uh professionally in engineering typically on the website for about nine years now across a range of industries from commodities trading to agriculture and real estate and i've also been a 5m developer for around three years now running a pretty sizable community called encore rp until we closed it earlier this year so that's a little bit about me um what we're going to cover in this episode is just getting your 5m server running so downloading the server getting it going uh everything you need to know to actually get connected to a local server and run around in it that's what we're going to cover and we're going to we're going to tackle two different approaches here tx admin and vanilla which i will dive into a little bit later before we do anything though the first thing that you'll need to do is get a license key for 5m so 5m is completely free you don't need to pay anything to get a license key or to use 5m or to run a 5m server and the way you get a license key is first you'll need a form account at forum.cfx.re these links are pretty easy to find from the 5m docs or even the homepage once you've got a account here you'll want to go to keymaster.5m.net and in here you'll be able to register a license key which you'll then use once you're setting up your server now there are some features that aren't included in free license keys and for those you would need a patreon subscription there's a couple tiers of patreon subscriptions to 5m um the the the lowest that gives you any sort of meaningful benefits being argentum and uh the the highest being platinum and these features range from at the lowest level you get 64 slots on one sync that's 64 concurrent players some cosmetics in the server list or the server search for your server orem includes 128 slots and some more cosmetics and then same with platinum is going to give you uh 2048 slots and more cosmetics now one thing that's important to know if you're developing a server and you for example need to test your custom clothing or something like that is that you don't actually have to pay to get access to all of the paid features so as long as you set your slot count to eight or less you can access all of these features including custom clothes streaming for free which is really great for development you're not going to spend need to spend any money while you're building out your server and eight slots is you know more than enough for you and a couple testers or other developers to work together on it so as i mentioned today we're going to be looking at two different ways of setting up your server one of them is using tx admin and the other one is what they call a vanilla installation so tx admin is a really useful utility built on top of 5m that adds a bunch of features that are very useful in a production environment so it offers easy remote management of your server stopping restarting automatic scheduled restarts restarting resources performance monitoring player management allow lists banned lists sending warnings to players kicking players and things like that as well as it offers it now offers some in-game tools for spectating players and things like that so tx admin is really useful in a production environment there's also what they call a vanilla fx server which is just running the bare bone server itself no no fanciness no web gui nothing else on top of it i think nowadays most most developers are probably running tx admin in production i personally use vanilla fx server in development because i don't really need like player management and all of that stuff you know automatic restarts or any of those features that tx admin offers in my local development environment so i prefer to keep things dirty fast and bare bones with a vanilla fx server when i'm developing locally and then when i'm running a public server then i'll use tx admin so we're going to run through the both ways that you set it up and look at how that process goes so the first one that we're going to start with is tx admin because that's the easiest and all of the links that i've mentioned here things that you might need to to access are going to be down below in the description so definitely check that out uh but the basics for a tx admin setup is that we're just going to go to the archive server for windows because that's what i'm on and download the latest recommended build there are lots of builds there's usually multiple builds a day you can see there were three of them yesterday alone but 5m will tag certain ones as recommended and uh that's going to have the longest uh support period for it so let's just go ahead and download the latest recommended and then if we open this up we got a whole boatload of files we're going to want to drop this somewhere convenient on our computer i've just created a folder here on my desktop called 5m where i'm going to drag all of these files into and with that out of the way all we're going to do is we're going to locate fxserver the executable in this new folder that we have and double click it and it should open a tab in your browser to localhost 4120 which is the port for tx admins control panel it's probably going to autofill this for you if not the pins over here in your console and hit link account and then you are going to connect your 5m account or your 5m forum account which you hopefully already have and now we'll just create a backup password in case things go haywire obviously a good idea to write this down somewhere safe i use a password manager and now we're going to jump right into kind of the quick setup from tx admin so this is what's really great is there's not a whole lot of configuration that has to be done it's going to do 90 of the work for you so we're just going to give ourselves a server name and now it's going to ask us for a deployment type another neat feature of tx admin is that they have some pre-built templates for things like cubic or esx which you might be familiar with however in our case we're going to select cfx default which is just the absolute bare minimum that we need to get a server up and running and then you know if you were maybe going to use cubic or esx you could always install that later now it's just going to prompt us for a place to throw the data it's recommended a folder called tx data on my desktop that's fine with me for this so go ahead and hit save and then we're going to go to the recipe deployer and this will just give us a preview of the recipe that it's going to execute and if we hit next now comes that license key that we talked about earlier which you'll want to grab from key master so i'll just do that real quickly go in here copy one of my keys and then hit run recipe and it'll do all the work for us and now that things are done we'll hit next it'll give us the opportunity to configure our server.cfg config file which there might be some additional things in here that you want to drop in for me the only thing i'm going to do is i'm going to change locale to en us for us english and hit save and run server and the first time this runs it'll take a couple seconds you'll see some notices about yarn that's just installing and building the chat resource and with all of the building wrapped up believe it or not that's all it takes we've got our own local 5m server now so if we go ahead and open 5m towards the middle where you have supporters history and favorites you'll see a new option down here and this is going to be called whatever your local computer is called and this is your quick connect directly to your local server so if we click that we'll be able to jump straight in and here we are believe it or not you are now in your own 5m server that's uh that's all it took so you're not gonna have a whole lot here you're not gonna have any you know any features any money um any inventory anything like that you're not even gonna have any weapons but otherwise the game works um just kind of like you would expect free mode to you can steal cars and rob people and guns might drop on the ground if you you know you wipe out a cop something like that you can get wanted levels um so you're in your 5m server all right let's move on to the vanilla fx server which is a little bit more involved um we're going to do a little bit more manual config and we're also going to need to use git so if you're not familiar with git uh there's plenty of tutorials out there to learn a little bit about that but you'll need that in your system just to clone the server data folder so it starts roughly the same as the other one did where we're going to make sure we grab the latest recommended build of 5m and then in my 5m folder here i've just i've cleared out everything that we had before and i've created a new server folder and then i'm going to drop all of this stuff from before into our server folder with that out of the way you'll also probably want to have a code editor handy i'm going to be using vs code since it has a built-in terminal which is really useful and i've got my 5m folder open here and you'll see we have our server folder with all of our stuff in it now if we go back to the guide on the 5m documentation uh we've got our git clone command here we're just going to want to copy that and paste it into command prompt and that'll clone our server data folder for us and if we take a peek in here you'll see we have some built-in resources like base events run code arcon log map and spawn manager and all of those goodies now before tx admin created our config file for us in this case we're going to need to create it ourselves so in my server data folder i'm going to create a new file and called it sir call it server.cfg and then if we reference this page again it has a template server cfg for us to grab that's pretty simple and you can certainly read through all of this and learn what each of the things do there's only a couple changes that i'm going to make here the first is i'm just going to change my locale to enus and another one here is sv master 1 right here so if we given this as a development server and i don't really want people to be able to connect to it if i uncomment this line by removing the hash mark then uh this will show up as private and the server browser people won't be able to click to connect to it um obviously we don't want random people discovering our development server and connecting to it the next thing i'm going to do is i'm just going to change my max clients down to i usually set it to three for development that's enough for me my girlfriend and then another tester to hop on and test things together and then finally the very last thing we're going to change is our license key which we're going to drop this in here from key master just like before and we hit save on that we're now ready to start our server so unlike tx admin we're actually going to need to execute a command to start our server here and so what you're going to want to do is you're going to want to execute the fxserver.exe executable in the server folder so for me that's going to be c users charles desktop 5m server fxserver.exe and then we're going to do plus exec for execute and then our server.cfg oh you know what i'm going to want to jump into the server data directory let's make things a little bit easier all right and now we'll execute our server.cfg and if we hit enter and just like the first time we started up our tx admin server you're going to get some yarn stuff here while it sets up the chat resource so i'll give it just a second to finish that and with that wrapped up just like before if we go ahead and open 5m you'll find that we can connect to our local server and once again here we are in our local server and uh wow it's placed me quite a bit away from any vehicles but um hopefully you'll get a better spawn point and maybe you can find a vehicle steal it and just kind of explore the free roam world all right so hopefully now you know two different ways to set up an fx server and you know the pros and cons of both of them and you can choose for yourself you know there's nothing wrong with using tx admin for local development too if you find it easier to just double click on something to run your server than running server commands or that's that's totally fine and up to you but uh now you you're empowered to run either tx admin or vanilla in development and i hope you found this useful in the next episode we're going to dive into actually writing some code and creating our first resource so the first thing that we're going to do is um we're going to kind of try we're going to change the spawn logic a little bit so we spawn in a more reliable location than randomly up in the hills and once we learn a little bit about scripting and resource creation through the process of creating that um spawn script then we're gonna dive into spawning a car uh in the episode after that so definitely uh follow along we've got some great stuff coming up if you enjoyed the episode be sure to hit like uh don't forget to subscribe and check the bell icon so you can get notified when the next episode comes out and uh yeah there's resources down below in the description there's also a discord link for my personal discord i've got a scripting help channel in there if you have any questions or anything feel free to drop in i try to be as responsive as possible and the goal is to yeah definitely grow that community and make sure we have a good group of really helpful people that can build each other up so once again thank you for tuning in to the first episode of our zero2hero 5m development tutorial and i hope to see in the next one
Info
Channel: CharlesHacks
Views: 76,871
Rating: undefined out of 5
Keywords: fivem scripting, fivem development, fivem lua, lua fivem, fivem scripting tutorial, fivem coding, fivem server development, fivem development tutorial, lua tutorial, fivem lua tutorial, fivem tutorial, fivem dev, fivem lua scripting, fivem developer, fivem coding tutorial, gta 5 modding tutorial, how to dev a fivem server, lua tutorial for beginners, lua fivem tutorial, how to make fivem scripts, charleshacks, zero to hero, master series, esx, qbcore, fivem rp, nui
Id: PkccHfNAbEs
Channel Id: undefined
Length: 13min 52sec (832 seconds)
Published: Fri Jul 15 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.