GetWeather: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Automatyczna aktualizacja dokumentacji funkcji
 
Complete Lua function catalog
 
Line 26: Line 26:
* The returned value is server state, not a direct read from one client's renderer.
* The returned value is server state, not a direct read from one client's renderer.


[[Category:Lua Functions]]
[[Category:Server Functions]]
[[Category:Server Functions]]
[[Category:World Functions]]
[[Category:World Functions]]

Latest revision as of 09:53, 15 August 2026

getWeather

Returns the canonical name of the server's authoritative weather state.

Syntax

string weather = getWeather()

Parameters

This function does not accept parameters.

Returns

Returns one of sunny, cloudy, rain1, rain2, or rain3.

Examples

Report the current weather to a player:

addCommandHandler("weather", function(playerId)
    outputChatBox("Current weather: " .. getWeather(), playerId)
end)

Notes

  • Available only in server-side resource scripts.
  • The returned value is server state, not a direct read from one client's renderer.