Open Road MP

The mp object

The global mp object and where to find each part.

Everything a gamemode can use is in the global object mp. The same information is in the TypeScript types that come with the server (scripting/types/openroadmp.d.ts), so your editor shows it while typing.

mp.eventsEvents: players joining and leaving, chat, and everything that happens in their game.
mp.playersPlayers: money, vehicles, position, messages, kicking - and the list of who is online.
mp.chatServer messages in the chat.
mp.commandsChat commands of the gamemodes.
mp.jobsFreight jobs for players (also as JobBuilder).
mp.rulesGame rules for everyone: police, traffic, fatigue ...
mp.vehiclesThe trucks of the game.
mp.logWriting to the server log.
mp.companiesYour own companies: players in a company see its name and logo as their own company in the game.
mp.storageData that survives restarts: for the gamemode and per player (Open Road MP account). Plain JSON files in <gamemode>/data/.
mp.zonesAreas on the map with enter/leave events: depots, race checkpoints, speed zones, no-go areas.
mp.rolesRoles of players (moderator, driver, ...), kept by Open Road MP account. Admins come from server.cfg (admins).
mp.bansBans by Open Road MP account, also with an end.
mp.httpData for the outside world on the server's web server.
mp.configServer settings that can change while it runs.
mp.worldThe map: cities, company depots, fuel stations and more, cargo - and the time of day.
mp.mapMarkers on the server's live map (the web page).
mp.markersMarkers in the players' 3D world: a hologram of the game itself (16 symbols, 9 colours) up to 250 m from the truck, above it a label with the distance (to the metre, counting while they drive), hidden behind buildings and terrain unless throughObjects. For everyone or only certain players.
mp.serverName, slots and game of the server.
JobBuilderBuilds a freight job and assigns it to a player.
UiView, uiWindows and HUD panels (menus, shops, forms) from building blocks; mp.ui.notify for notices at the top of the HUD.

Further: all types and the offences of playerFined.