~/vipex/docs_

Admin Tools

Console commands for server administration and recovery.

mdt_setadmin

Promotes a player to department admin from the server console. Handles every edge case — missing departments, missing ranks, inactive staff, offline players — so you never need to touch raw SQL.

mdt_setadmin <identifier> <job>
ParameterDescription
identifierPlayer's framework identifier (e.g. citizen ID, license, etc.)
jobJob name matching a key in your departments config (e.g. police, bcso, ambulance)

This command only works from the server console (source 0). It cannot be run by players in-game.

What it does

  1. Resolves the department — looks up the job in the database. If it doesn't exist yet but is defined in your config, the department is auto-created (including its default admin rank, templates, and licenses).
  2. Finds or creates an admin rank — searches for a rank with the wildcard (*) permission. If none exists, creates an "Admin" rank at the highest priority.
  3. Resolves the staff record — if the player already has a staff record that is fired, suspended, on leave, or inactive, it reactivates them. If no staff record exists, it creates one (using the player's real name if they're online, or a placeholder "Admin Recovery" if offline).
  4. Promotes to admin — sets the staff member's rank to the admin rank.
  5. Syncs live state — if the player is online, updates their rank via state bags immediately. Invalidates all rank and permission caches.

Examples

Server Console
mdt_setadmin license:abc123 police
mdt_setadmin AB12CD34 bcso

Edge cases

ScenarioBehavior
Job not in config or databasePrints error, no changes made
Job in config but not in databaseAuto-creates department with defaults
No rank with * permission existsCreates "Admin" rank at top priority
Staff record doesn't exist + player offlineCreates staff with placeholder name "Admin Recovery"
Staff record doesn't exist + player onlineCreates staff with player's real character name
Staff is fired / suspended / on leave / inactiveReactivates to "active" then promotes
Player is onlineLive rank sync via state bags
Player is offlineDatabase updated, sync applies on next join

On this page