Docs

Who may do what

Owners can do everything. Everybody else can do only what a rule gives them, action by action.

Words on this page

  • Server console: the server's own window, or Live Console in txAdmin. Commands such as sqlperm code are typed there, not in the game's chat.
  • Server id: the number a player has while connected, shown next to their name in txAdmin's player list. It changes every time they join.
  • Identifier: a fixed ID of a player's account that never changes, such as license:1a2b3c... or discord:123456.... In txAdmin, click a player and open the IDs tab to see theirs.

Owners

Owners are only ever made from the server, never from the panel. Any one of these is enough:

  • The claim code. The easiest way. Type sqlperm code in the server console, then type /sqlclaim <code> in the game's chat with the code it printed. The code works once, for 10 minutes. A player who types a wrong code 3 times cannot try again until the next restart. When the server has no owner at all, a code is printed at every start.
  • The console. sqlperm owner add <server id or identifier>, for example sqlperm owner add 12 for the player on server id 12 (they must be online), or sqlperm owner add license:1a2b3c....
  • server/permissions.lua. An ace (add_ace group.admin waw-sql.admin allow), a framework group (god, admin; QBCore, Qbox and ESX), a licence, Discord, Steam or citizen ID in Customs, or a Discord role.
  • server.cfg. The waw_sql_owners convar: identifiers separated by commas.

The panel lists the owners under Maintenance → Settings → Permissions, with how each one was made: claim code, console, server.cfg or permissions.lua.

Can't open the panel?

Out of the box, the god and admin framework groups are owners. If you are in neither, type sqlperm code in the server console and /sqlclaim <code> in game.

Rules for everybody else

Owners write rules in the panel under Maintenance → Settings → Permissions. A rule is for a player, a Discord role, an ace or a framework group, and it ticks the actions they may take, one by one. For example: seeing player data but not editing it, or taking a backup but not restoring one.

  • An action brings along what it cannot work without.
  • Quick picks (Viewer, Support, Maintenance) tick common sets; Everything and None tick or clear every action.
  • Restoring a backup, deleting a player, deleting a backup and handing out permissions are never in a quick pick.

A rule for a player can name their licence or, with a citizen ID such as cid:ABC12345, one character only.

Who can do what, on the same page, shows for a player who is online what they may do and which rule gives it to them, like sqlperm check in the console.

An owner can give "hand out permissions" to someone. That person can then write rules too, but only with the actions they have themselves. They cannot pass "hand out permissions" on, and cannot change a rule that holds an action they don't have.

The panel hides what a player may not use, and every request is checked again on the server. A change to a rule reaches open panels at once. The rules are saved in waw-sql-data/access.json, so an update does not touch them. Every change is written to the server console and the Discord log.

Discord roles

Rules for Discord roles need a Discord bot, so waw-sql can ask Discord which roles a player has. The bot needs no permissions and sends no messages. Setting it up:

  1. Go to discord.com/developers/applications, press New Application and give it a name.
  2. Open Bot, press Reset Token and copy the token. Keep it secret: anyone with it controls the bot.
  3. Open OAuth2 → URL Generator, tick bot, open the link at the bottom and add the bot to your Discord server.
  4. In Discord, turn on Developer Mode (User Settings → Advanced), then right-click your server's icon and choose Copy Server ID.
  5. Put both in server.cfg and restart the server:
server.cfg
set waw_sql_discord_token "your bot token"
set waw_sql_discord_guild "your Discord server ID"

A role taken away in Discord stops working within a minute. FiveM only knows a player's Discord account when the Discord app is open on their PC as they join, so a player who joins without it is not matched by Discord role rules.

Console commands

commandwhat it does
sqlperm codea one-time claim code
sqlperm owner addadd an owner
sqlperm owner removeremove an owner
sqlperm owner listlist the owners
sqlperm rulesthe rules written in the panel
sqlperm check <server id>what that player may do, and which rule gives it
sqlperm reset confirmdelete every rule; the owners stay