How do I make my FiveM server whitelist only?
The easiest way to whitelist a FiveM server is txAdmin's built-in whitelist, which can admit only approved players, Discord server members or holders of specific Discord roles. For custom flows, a resource can check players in the playerConnecting event using deferrals and reject anyone not on your list. Pair the technical gate with a clear application process so good players can actually get in.
Decide what kind of whitelist you want
A whitelist is a business decision before it is a config change. Common models:
- Application whitelist: players apply, staff review, approved players get in. Typical for serious roleplay.
- Discord member whitelist: anyone in your Discord can join. A light filter that removes drive-by trolls.
- Discord role whitelist: only members with a given role, such as "Citizen" after verification or an interview.
- Partial whitelist: the server is open, but certain jobs (police, EMS, gangs) require approval.
A full application whitelist lowers your player count and makes growth slower, so be honest about whether you need it. See the whitelist glossary entry for the general concept.
Option 1: txAdmin whitelist
txAdmin includes a whitelist system in its player management. Depending on your version, you can typically choose between modes such as:
- Admin-only, for maintenance
- Approved license, where staff approve each join request
- Discord server member
- Discord server roles
For Discord modes, you set up the txAdmin Discord bot and point it at your guild and roles. Players who are rejected see a message and, in approval mode, a request appears for staff to accept. This covers most servers without writing any code.
Option 2: A custom resource
If you need logic txAdmin does not offer, such as checking a website database, use the connection deferral API. A minimal server-side example:
local allowed = {
["license:abc123"] = true,
}
AddEventHandler("playerConnecting", function(name, setKickReason, deferrals)
local src = source
deferrals.defer()
Wait(0)
deferrals.update("Checking whitelist...")
local license = GetPlayerIdentifierByType(src, "license")
if license and allowed[license] then
deferrals.done()
else
deferrals.done("You are not whitelisted. Apply in our Discord.")
end
end)
In practice you would load the list from your database rather than hard-coding it. Always identify players by license or another stable identifier, never by name.
Make the application process work
The technical gate is the easy part. Whitelists fail when nobody reviews applications.
- Keep the form short: age, roleplay experience, a short character backstory, rules acknowledgment.
- Promise a review time and meet it. A 48-hour target is common.
- Give staff a simple accept and decline template.
- Tell rejected players why and when they can reapply.
- Track how many applications you receive and approve each week.
Rules and appeals
Whitelisted servers usually enforce stricter rules. Make sure removed players have a clear appeal path, or your Discord will fill with arguments instead of applications.
Checklist
- Whitelist model chosen and announced
- txAdmin whitelist or custom resource tested with a non-staff account
- Application form live and linked in Discord
- Review team and response time defined
- Maintenance mode available for updates