DDoS, proxy, and networking basics
Owners ask the same three questions: why can nobody join, why does it lag under load, and why am I getting attacked. This lesson gives you the mental model and a tiny resource that prints your live networking config so the numbers stop being abstract. You will not become a network engineer, but you will stop guessing and know what to check and what to ask your host.
Build it
We are going to make the networking config concrete. This is a server-only resource that reads your live network settings and prints them to the console, so the ports, the OneSync mode, and the player cap stop being words in a guide and become numbers you can see. Follow the names exactly. Once it prints, the next section takes it apart and explains what each number controls.
Make the resource folder
Inside your server's resources folder, create this folder:
resources/qu_networking_basics
Create the files
Create this exact file layout:
resources/qu_networking_basics/
fxmanifest.lua
server.lua
Set the endpoints in server.cfg
Open server.cfg. Near the top, where your other networking lines live, make sure both endpoints are declared on the same port:
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
0.0.0.0 means "listen on every network interface on this machine", and 30120 is the port players connect to. If you only ever see one of these lines in a guide, add the other. The TCP line alone gets you a handshake but no gameplay; the UDP line alone gets you gameplay the handshake never reaches.
Write fxmanifest.lua
Open fxmanifest.lua and paste this:
fx_version 'cerulean'
game 'gta5'
server_script 'server.lua'
No lua54 line. As of June 2025 that directive is deprecated and ignored, because Lua 5.4 is now the only Lua runtime.
Write the lesson code
Open server.lua and paste this:
RegisterCommand('netinfo', function()
local port = GetConvarInt('netPort', 30120)
local maxClients = GetConvarInt('sv_maxClients', 48)
local oneSync = GetConvar('onesync', 'off')
print('[qu_networking_basics] game port (TCP+UDP): ' .. port)
print('[qu_networking_basics] txAdmin panel port: 40120')
print('[qu_networking_basics] sv_maxClients: ' .. maxClients)
print('[qu_networking_basics] onesync: ' .. oneSync)
end, true)
Keep reading the full lesson
Sign in to start, then unlock every step of this lesson and the full FiveM School with a membership.
- How it works
- If something went wrong
- What you can do now
- Try it yourself
The remainder of DDoS, proxy, and networking basics is available to FiveM School members.