mp.rules
Read and change the game rules, and every rule there is.
set
mp.rules.set<K extends RuleKey>(key: K, value: Rules[K]): voidChanges a gameplay rule for all players. The server list shows it within a minute.
get
mp.rules.get(): Readonly<Rules>The current gameplay rules.
All rules
Start values go into server.cfg as rule_<name> (e.g. rule_police = false); in the server console: rule police off. The server list shows the most important ones to players before they connect.
| Rule | Type | Default | Description |
|---|---|---|---|
police | boolean | true | Police patrols in traffic that enforce offences. Game setting g_police. |
fines | boolean | true | The game charges fines (speed cameras, red lights, ...) itself. Off: the game charges nothing, playerFined still fires (amount 0) and the gamemode decides. |
traffic | number 0-10 | 1 | AI traffic density. 0 = no AI traffic, 1 = normal. Game setting g_traffic. |
fatigue | boolean | true | Drivers get tired and need to sleep. Game setting g_fatigue. |
fuelSimulation | boolean | true | Trucks consume fuel and have to refuel. Game setting g_fuel_simulation. |
speedLimiter | boolean | false | The truck's speed limiter is always on (90 km/h in Europe according to the game). Game setting g_use_speed_limiter. |
hardcoreSimulation | boolean | false | The game's stricter simulation mode (g_hardcore_simulation). Game setting g_hardcore_simulation. |
mandatoryBreak | boolean | true | Driving and rest times with mandatory breaks. Game setting g_mandatory_break. |
roadEvents | number 0-1 | 1 | Frequency of accidents and roadside events. 0 = none. Game setting g_road_events. |
detours | number 0-1 | 1 | Frequency of road works and detours. 0 = none. Game setting g_detours. |
badWeather | number 0-1 | 0.07 | Share of rain and bad weather. 0 = always dry, 1 = always rain. The game rolls the weather from it every few tens of minutes; mp.world.setWeather changes it at once. Game setting g_bad_weather_factor. |
incomeFactor | number 0-10 | 1 | Multiplier on the pay of the game's jobs. Game setting g_income_factor. |
truckStability | number 0-1 | 0.5 | Truck roll-over stability (game setting). Higher = harder to tip over. Game setting g_truck_stability. |
trailerStability | number 0-1 | 0.5 | Trailer roll-over stability (game setting). Higher = harder to tip over. Game setting g_trailer_stability. |
timeZones | boolean | false | The clock jumps at time zone borders. Game setting g_time_zones. |
advancedCoupling | boolean | false | Trailers have to be approached precisely to couple (realistic coupling). Game setting g_trailer_advanced_coupling. |
loadNeedsEngineOff | boolean | true | Loading and unloading only with the engine off. Game setting g_cargo_load_require_engine_off. |
loadNeedsParkBrake | boolean | false | Loading and unloading only with the parking brake applied. Game setting g_cargo_load_require_park_brake. |
companyJobs | boolean | true | Players can take jobs with the company's trailer (in the game: Freight Market, German: Frachtaufträge; own truck). Off: the entry is gone from the game menu and its tab in the job screens is locked. Jobs a gamemode assigns (mp.jobs.assign) still work. |
ownTrailerJobs | boolean | true | Players can take jobs with their own trailer (in the game: Cargo Market, German: Frachtmarkt; own truck and own trailer). Off: the entry is gone from the game menu and its tab in the job screens is locked. |
quickJobs | boolean | true | Players can take quick jobs (a company truck, the player is moved there). Off: the entry is gone from the game menu and its tab in the job screens is locked. |