Open Road MP

Admins, roles and bans

Who may do what on your server, and who is not welcome.

Admins

Admins are set in server.cfg by their Open Road MP account ID (on the player's account page at openroadmp.com):

admins = [oprmp:KXQTRB-4821, oprmp:MWZPLA-0193]

player.isAdmin is true for them, and they pass every role check.

Roles

A role is a name of your choice - moderator, driver, vip. It is kept by account (data/roles.json of your gamemode):

mp.roles.set(player, "moderator")
mp.roles.get(player)               // "moderator", "admin" for admins, or null
mp.roles.has(player, "moderator")  // true - admins have every role
mp.roles.set(player, null)         // takes the role away

Commands only for a role

mp.commands.add("kick", "<id> - kicks a player", (player, [id]) => {
  const target = mp.players.get(Number(id))
  if (target) mp.players.kick(target, `Kicked by ${player.name}`)
}, { role: "moderator" })

Everyone else gets a short "no permission" answer in their language.

Bans

Bans go by Open Road MP account - a banned player cannot come back under another name or from another IP.

mp.bans.add(player, { minutes: 60, reason: "Ramming" }) // for an hour
mp.bans.add("oprmp:KXQTRB-4821", { reason: "Cheating" }) // for ever, also offline
mp.bans.remove("oprmp:KXQTRB-4821")
mp.bans.list()        // [{ accountId, until, reason }]
mp.bans.isBanned(id)

A banned player online leaves the server at once. Trying to join, they see the reason and the end of the ban. Bans are kept in the server's ban_file and also come from the server console (ban, unban, bans).

On this page