{"id":91688,"date":"2024-02-05T09:21:55","date_gmt":"2024-02-05T08:21:55","guid":{"rendered":"https:\/\/fivem-mods.net\/?p=91688"},"modified":"2026-07-22T20:59:44","modified_gmt":"2026-07-22T18:59:44","slug":"schnee-aktivieren","status":"publish","type":"post","link":"https:\/\/rpcrate.com\/de\/enable-snow\/","title":{"rendered":"Wie man Schnee in FiveM aktiviert"},"content":{"rendered":"<p>Enable FiveM snow with a small resource: the server owns the state, ACE protects the command, and clients apply documented weather natives.<\/p>\n<p>The configuration and code examples here target FiveM for GTA V Legacy. Enhanced has different runtime and compatibility rules; check <a href=\"https:\/\/docs.fivem.net\/docs\/developers\/legacy-vs-enhanced\/\">Cfx.re\u2019s Legacy-to-Enhanced changes<\/a> before applying them to an Enhanced server.<\/p>\n<h2 id=\"create-the-resource\">Create the resource<\/h2>\n<p>Create a resource folder such as resources\/[local]\/fmx-snow and add the following fxmanifest.lua. The manifest uses the current cerulean FXv2 version, declares GTA V, and loads one client and one server script.<\/p>\n<pre data-no-translation=\"\" translate=\"no\"><code data-no-translation=\"\" translate=\"no\">fx_version 'cerulean'\ngame 'gta5'\n\nclient_script 'client.lua'\nserver_script 'server.lua'<\/code><\/pre>\n<h2 id=\"keep-the-switch-on-the-server\">Keep the switch on the server<\/h2>\n<p>Put this in server.lua. The command accepts only on or off and leaves the state unchanged after any other argument. Its restricted RegisterCommand delegates access to ACE; assign the fmxsnow-admin principal only to the small operator group that needs it. GlobalState supplies the current server-owned value to clients.<\/p>\n<pre data-no-translation=\"\" translate=\"no\"><code data-no-translation=\"\" translate=\"no\">local snowEnabled = false\nGlobalState.fmxSnowEnabled = false\n\nRegisterCommand('fmxsnow', function(source, args)\n    local mode = args[1]\n    if mode ~= 'on' and mode ~= 'off' then\n        print(('fmxsnow: usage fmxsnow on|off (source %s)'):format(source))\n        return\n    end\n\n    snowEnabled = mode == 'on'\n    GlobalState.fmxSnowEnabled = snowEnabled\nend, true)<\/code><\/pre>\n<pre data-no-translation=\"\" translate=\"no\"><code data-no-translation=\"\" translate=\"no\">add_ace group.fmxsnow-admin command.fmxsnow allow\nensure fmx-snow<\/code><\/pre>\n<h2 id=\"render-the-state-on-each-client\">Render the state on each client<\/h2>\n<p>Put this in client.lua. The client reads the replicated GlobalState value at startup, listens for later state-bag updates, and uses the documented weather natives. No client event can change the server-owned state.<\/p>\n<pre data-no-translation=\"\" translate=\"no\"><code data-no-translation=\"\">local function applySnow(enabled)\n    if enabled then\n        SetWeatherTypeNowPersist('XMAS')\n        SetOverrideWeather('XMAS')\n    else\n        ClearOverrideWeather()\n        ClearWeatherTypePersist()\n    end\nend\n\nAddStateBagChangeHandler('fmxSnowEnabled', nil, function(_, _, value)\n    applySnow(value == true)\nend)\n\napplySnow(GlobalState.fmxSnowEnabled == true)\n\nAddEventHandler('onClientResourceStop', function(name)\n    if name == GetCurrentResourceName() then\n        ClearOverrideWeather()\n        ClearWeatherTypePersist()\n    end\nend)<\/code><\/pre>\n<p>Add ensure fmx-snow to server.cfg after saving the files, then restart the resource or server. Test fmxsnow on and off with an authorized account, verify invalid arguments print the usage without changing the state, and confirm an unprivileged account has no command access.<\/p>\n<p>Primary sources: Cfx resource-manifest, server-command, native-reference and server-security documentation.<\/p>\n<h2 id=\"check-ownership-and-recovery\">Check ownership and recovery<\/h2>\n<p>Use only one weather controller. Disable competing weather synchronization on the test instance before running this example. It switches to XMAS immediately; it does not persist the choice across a resource\/server restart.<\/p>\n<p>GlobalState requires the server\u2019s state-awareness support. Assign the shown ACE group to your actual authorized administrator using your existing permission workflow. Test on\/off, reconnect and stopping the resource. After removing it, let your normal weather controller restore the intended weather.<\/p>\n<h2 id=\"reference-documentation\">Reference documentation<\/h2>\n<p><a href=\"https:\/\/docs.fivem.net\/docs\/scripting-reference\/resource-manifest\/\">Cfx.re \u2014 resource manifest<\/a> \u00b7 <a href=\"https:\/\/docs.fivem.net\/docs\/scripting-manual\/networking\/state-bags\/\">Cfx.re \u2014 state bags<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Aktiviere FiveM-Schnee mit einer kleinen Ressource: Der Server verwaltet den Zustand, ACE sch\u00fctzt den Befehl und Clients wenden dokumentierte Wetter-Natives an.<\/p>","protected":false},"author":1,"featured_media":91689,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1899],"tags":[],"class_list":["post-91688","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/rpcrate.com\/de\/wp-json\/wp\/v2\/posts\/91688","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rpcrate.com\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rpcrate.com\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rpcrate.com\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rpcrate.com\/de\/wp-json\/wp\/v2\/comments?post=91688"}],"version-history":[{"count":4,"href":"https:\/\/rpcrate.com\/de\/wp-json\/wp\/v2\/posts\/91688\/revisions"}],"predecessor-version":[{"id":213978,"href":"https:\/\/rpcrate.com\/de\/wp-json\/wp\/v2\/posts\/91688\/revisions\/213978"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rpcrate.com\/de\/wp-json\/wp\/v2\/media\/91689"}],"wp:attachment":[{"href":"https:\/\/rpcrate.com\/de\/wp-json\/wp\/v2\/media?parent=91688"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rpcrate.com\/de\/wp-json\/wp\/v2\/categories?post=91688"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rpcrate.com\/de\/wp-json\/wp\/v2\/tags?post=91688"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}