{"id":140759,"date":"2024-05-28T16:01:16","date_gmt":"2024-05-28T14:01:16","guid":{"rendered":"https:\/\/hifivem.com\/?p=140759"},"modified":"2026-09-11T11:41:21","modified_gmt":"2026-09-11T09:41:21","slug":"como-criar-o-iniciador-fivem-2","status":"publish","type":"post","link":"https:\/\/rpcrate.com\/pt\/how-to-create-fivem-launcher\/","title":{"rendered":"Criar um launcher FiveM com Windows Forms"},"content":{"rendered":"<p>Um pequeno launcher Windows Forms pode pedir ao Windows que abra a conex\u00e3o FiveM. Ele n\u00e3o instala FiveM, n\u00e3o ignora whitelist nem confirma a conex\u00e3o do jogador. Mantenha instru\u00e7\u00f5es normais para quem n\u00e3o deseja outro execut\u00e1vel.<\/p>\n<h2>Instala\u00e7\u00e3o e verifica\u00e7\u00e3o<\/h2>\n<p>No Visual Studio, instale desenvolvimento desktop .NET e crie uma Windows Forms App. Adicione um bot\u00e3o de conex\u00e3o e um Label chamado StatusLabel e associe o c\u00f3digo ao evento Click. O endere\u00e7o de exemplo \u00e9 local; configure seu servidor e porta antes de distribuir. Coloque as diretivas using no in\u00edcio do arquivo e o manipulador dentro da classe Form.<\/p>\n<pre data-no-translation=\"\" class=\"wp-block-code\" translate=\"no\"><code data-no-translation=\"\">using System;\nusing System.ComponentModel;\nusing System.Diagnostics;\n\nprivate void ConnectButton_Click(object sender, EventArgs e)\n{\n    const string serverAddress = &quot;127.0.0.1:30120&quot;;\n    try\n    {\n        Process.Start(new ProcessStartInfo(&quot;fivem:\/\/connect\/&quot; + serverAddress)\n        {\n            UseShellExecute = true\n        });\n        StatusLabel.Text = &quot;Launch requested&quot;;\n    }\n    catch (Win32Exception)\n    {\n        StatusLabel.Text = &quot;Windows could not open FiveM.&quot;;\n    }\n}<\/code><\/pre>\n<p>UseShellExecute entrega explicitamente o protocolo registrado ao Windows. Launch requested indica apenas o envio do pedido, n\u00e3o conex\u00e3o estabelecida. Teste com FiveM, sem manipulador de protocolo e com servidor indispon\u00edvel, verificando o resultado no FiveM.<\/p>\n<p>Para um projeto antigo .NET Framework, use a verifica\u00e7\u00e3o Framework da Microsoft; dotnet --version informa um SDK. Compile c\u00f3digo revisado e investigue alertas antiv\u00edrus em vez de excluir execut\u00e1veis desconhecidos. Esta revis\u00e3o n\u00e3o inclui teste independente no Windows.<\/p>\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"video-container\"><iframe loading=\"lazy\" title=\"FiveM Server Launcher \ud83d\ude80 | 100% Gr\u00e1tis! | Link para download na descri\u00e7\u00e3o \ud83d\udd3d\" width=\"1170\" height=\"658\" src=\"https:\/\/www.youtube.com\/embed\/vvkHhphYwc0?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen referrerpolicy=\"strict-origin-when-cross-origin\"><\/iframe><\/div>\n<\/div><\/figure>\n\n<h2>Fontes<\/h2>\n<p><a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/desktop\/winforms\/get-started\/create-app-visual-studio\">Fonte original<\/a><\/p>\n<p><a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/api\/system.diagnostics.processstartinfo.useshellexecute\">Fonte original 2<\/a><\/p>\n<p><a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/framework\/install\/how-to-determine-which-versions-are-installed\">Fonte original 3<\/a><\/p>\n<p><a href=\"https:\/\/docs.fivem.net\/docs\/scripting-manual\/introduction\/creating-your-first-script\/\">Fonte original 4<\/a><\/p>\n<p><a href=\"https:\/\/rpcrate.com\/pt\/introducao-lua-scripting\/\">Guia de servidor relacionado<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>Um pequeno launcher Windows Forms pode pedir ao Windows que abra a conex\u00e3o FiveM. Ele n\u00e3o instala FiveM, n\u00e3o ignora whitelist nem confirma a conex\u00e3o do jogador. Mantenha instru\u00e7\u00f5es normais para quem n\u00e3o deseja outro execut\u00e1vel.<\/p>","protected":false},"author":1,"featured_media":140761,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1899],"tags":[],"class_list":["post-140759","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/rpcrate.com\/pt\/wp-json\/wp\/v2\/posts\/140759","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rpcrate.com\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rpcrate.com\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rpcrate.com\/pt\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rpcrate.com\/pt\/wp-json\/wp\/v2\/comments?post=140759"}],"version-history":[{"count":2,"href":"https:\/\/rpcrate.com\/pt\/wp-json\/wp\/v2\/posts\/140759\/revisions"}],"predecessor-version":[{"id":217838,"href":"https:\/\/rpcrate.com\/pt\/wp-json\/wp\/v2\/posts\/140759\/revisions\/217838"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rpcrate.com\/pt\/wp-json\/wp\/v2\/media\/140761"}],"wp:attachment":[{"href":"https:\/\/rpcrate.com\/pt\/wp-json\/wp\/v2\/media?parent=140759"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rpcrate.com\/pt\/wp-json\/wp\/v2\/categories?post=140759"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rpcrate.com\/pt\/wp-json\/wp\/v2\/tags?post=140759"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}