{"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":"habilitar-la-nieve","status":"publish","type":"post","link":"https:\/\/hifivem.com\/es\/habilitar-la-nieve\/","title":{"rendered":"C\u00f3mo activar la nieve en FiveM"},"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<h2>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=\"\"><code data-no-translation=\"\">fx_version 'cerulean'\ngame 'gta5'\n\nclient_script 'client.lua'\nserver_script 'server.lua'<\/code><\/pre>\n<h2>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=\"\"><code data-no-translation=\"\">local snowEnabled = 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=\"\"><code data-no-translation=\"\">add_ace group.fmxsnow-admin command.fmxsnow allow\nensure fmx-snow<\/code><\/pre>\n<h2>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=\"\"><code data-no-translation=\"\">local function applySnow(enabled)\n    if enabled then\n        SetWeatherTypeOvertimePersist('XMAS', 15.0)\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)<\/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","protected":false},"excerpt":{"rendered":"<p>Activa nieve en FiveM con un recurso peque\u00f1o: el servidor controla el estado, ACE protege el comando y los clientes aplican natives meteorol\u00f3gicos documentados.<\/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:\/\/hifivem.com\/es\/wp-json\/wp\/v2\/posts\/91688","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hifivem.com\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hifivem.com\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hifivem.com\/es\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hifivem.com\/es\/wp-json\/wp\/v2\/comments?post=91688"}],"version-history":[{"count":4,"href":"https:\/\/hifivem.com\/es\/wp-json\/wp\/v2\/posts\/91688\/revisions"}],"predecessor-version":[{"id":213978,"href":"https:\/\/hifivem.com\/es\/wp-json\/wp\/v2\/posts\/91688\/revisions\/213978"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hifivem.com\/es\/wp-json\/wp\/v2\/media\/91689"}],"wp:attachment":[{"href":"https:\/\/hifivem.com\/es\/wp-json\/wp\/v2\/media?parent=91688"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hifivem.com\/es\/wp-json\/wp\/v2\/categories?post=91688"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hifivem.com\/es\/wp-json\/wp\/v2\/tags?post=91688"}],"curies":[{"name":"gracias","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}