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.events | Events: players joining and leaving, chat, and everything that happens in their game. |
mp.players | Players: money, vehicles, position, messages, kicking - and the list of who is online. |
mp.chat | Server messages in the chat. |
mp.commands | Chat commands of the gamemodes. |
mp.jobs | Freight jobs for players (also as JobBuilder). |
mp.rules | Game rules for everyone: police, traffic, fatigue ... |
mp.vehicles | The trucks of the game. |
mp.log | Writing to the server log. |
mp.companies | Your own companies: players in a company see its name and logo as their own company in the game. |
mp.storage | Data that survives restarts: for the gamemode and per player (Open Road MP account). Plain JSON files in <gamemode>/data/. |
mp.zones | Areas on the map with enter/leave events: depots, race checkpoints, speed zones, no-go areas. |
mp.roles | Roles of players (moderator, driver, ...), kept by Open Road MP account. Admins come from server.cfg (admins). |
mp.bans | Bans by Open Road MP account, also with an end. |
mp.http | Data for the outside world on the server's web server. |
mp.config | Server settings that can change while it runs. |
mp.world | The map: cities, company depots, fuel stations and more, cargo - and the time of day. |
mp.map | Markers on the server's live map (the web page). |
mp.markers | Markers 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.server | Name, slots and game of the server. |
JobBuilder | Builds a freight job and assigns it to a player. |
UiView, ui | Windows and HUD panels (menus, shops, forms) from building blocks; mp.ui.notify for notices at the top of the HUD. |