World::setWeatherTransition: Difference between revisions

From RAGE Multiplayer Wiki
(Created page with "This property gets/sets game weather. ==Getter== * '''<span style="color:#008017">String</span>''' ==Setter== * '''<span style="color:#008017">String</span>''' ==Example==...")
 
No edit summary
 
(7 intermediate revisions by 5 users not shown)
Line 1: Line 1:
This property gets/sets game weather.
__TOC__


==Getter==
{{ServersideJsFunction}}
* '''<span style="color:#008017">String</span>'''


==Setter==
This function start a weather transition to the weather specified and sync it to all clients.
* '''<span style="color:#008017">String</span>'''
 
{{JSContainer|
== Syntax ==
<pre>mp.world.setWeatherTransition(weather, easeTime)</pre>
 
== Required Arguments ==
*{{Required}}'''weather''': {{RageType|String}} ([[Weather]])
*'''easeTime''': {{RageType|Int}} (Weather transitioning time)
'''Note''': the second use with easeTime field seems to be buggy, it has graphical issues with transition from SMOG to FOGGY weather (and probably with some other weather), so right now the best choice would be to do weather transition on client side and sync it manually.


==Example==
==Example==
<source lang="javascript">
{{ServersideCode|
mp.environment.setWeatherTransition
<pre>
</source>
mp.world.setWeatherTransition("CLEARING"); // Set's the server's weather to 'CLEARING' immediately
</pre>
<pre>
mp.world.setWeatherTransition("CLEARING", 600000); // Set's the server's weather to 'CLEARING' with 10 minutes transition
</pre>
}}
}}


==References==
==See Also==
[[Category:Weather API]]
{{World_definition}}

Latest revision as of 08:55, 7 December 2019

Server-Side
Function

 JavaScript



This function start a weather transition to the weather specified and sync it to all clients.

JavaScript Syntax

Syntax

mp.world.setWeatherTransition(weather, easeTime)

Required Arguments

  • *weather: String (Weather)
  • easeTime: Int (Weather transitioning time)

Note: the second use with easeTime field seems to be buggy, it has graphical issues with transition from SMOG to FOGGY weather (and probably with some other weather), so right now the best choice would be to do weather transition on client side and sync it manually.

Example

Server-Side
mp.world.setWeatherTransition("CLEARING"); // Set's the server's weather to 'CLEARING' immediately
mp.world.setWeatherTransition("CLEARING", 600000); // Set's the server's weather to 'CLEARING' with 10 minutes transition


See Also