SetWeatherBlended: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
(It's not directly 2 hours, it's 1-2 hours)
 
(18 intermediate revisions by 11 users not shown)
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
This function will change the weather from the current weather (set using [[setWeather]]) to another weather state over a period of 60 seconds.
{{Server client function}}
This function will change the current [[weather]] to another in a smooth manner, over the period of 1-2 in-game hours (unlike [[setWeather]], which sets a new weather instantly). To ensure this transition performs as expected, you should not call this function until [[getWeather]] indicates that no transition is already being done.


==Syntax==  
==Syntax==  
Line 8: Line 9:


===Required Arguments===  
===Required Arguments===  
*'''weatherID:''' The ID of the weather state you wish to set. Valid values are 0 to 19 inclusive.
*'''weatherID:''' The ID of the [[weather]] state you wish to set. Valid values are 0 to 255 inclusive.


===Returns===
===Returns===
Line 14: Line 15:


==Example==  
==Example==  
This example sets the weather to sunny, then makes it change to a thunderstorm over the period of a minute.
This example sets the weather to sunny, then makes it change to a foggy over the period of one-two hours (assuming that a in-game hour is a minute in real time).
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
-- Set the weather to sunny
-- Set the weather to sunny
setWeather ( 0 )
setWeather ( 0 )
-- Blend the weather to thunderstorm
-- Blend the weather to foggy
setWeatherBlended ( 9 )
setWeatherBlended ( 9 )
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{World_Functions}}
{{World functions}}
 
[[ru:setWeatherBlended]]

Latest revision as of 10:31, 24 June 2018

This function will change the current weather to another in a smooth manner, over the period of 1-2 in-game hours (unlike setWeather, which sets a new weather instantly). To ensure this transition performs as expected, you should not call this function until getWeather indicates that no transition is already being done.

Syntax

bool setWeatherBlended ( int weatherID )

Required Arguments

  • weatherID: The ID of the weather state you wish to set. Valid values are 0 to 255 inclusive.

Returns

Returns true if successful, false if an invalid weatherID is passed.

Example

This example sets the weather to sunny, then makes it change to a foggy over the period of one-two hours (assuming that a in-game hour is a minute in real time).

-- Set the weather to sunny
setWeather ( 0 )
-- Blend the weather to foggy
setWeatherBlended ( 9 )

See Also

Shared