world.setWeather
Sets the shared weather. Every player’s game changes to it.
Signature
Section titled “Signature”world.setWeather(weather: number): Promise<ActionResult>Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
weather |
number |
GTA:SA’s weather type, 0 to 22 (for example 8 is rain); all of them on Weather. |
Returns
Section titled “Returns”A promise of an ActionResult: applied once the server has changed it for everyone (also when it already was so), or rejected with vetoed when a server-side rule refused it. Out of range is invalid-weather.
Example
Section titled “Example”import { world } from "nativemp";
await world.setWeather(8); // rainRelated
Section titled “Related”world.getWeather: read itworldStateChanged: it changed