HeyWeeknd Posted January 11, 2023 Share Posted January 11, 2023 Como faço pra ocultar o hud, radar e level na hora de logar? (só aparecer quando fizer o login ou registro) Codigo do Painel (server) addEvent('Schootz.registrar', true) addEventHandler('Schootz.registrar', root, function (player, account, password) if tostring(account) and tostring(passaword) then if #account >= 4 and #password >= 4 then if not string.find(account, ' ') and not string.find(password, ' ') then if #getAccountsBySerial(getPlayerSerial(player)) < config.contas then if not getAccount(account) then if addAccount(account, password) then local accountdata = getAccount(account) logIn(player, accountdata, password) exports['FR_DxMessagesLOGIN']:addBox(player, "Conta criada com sucesso!, Bem-vindo(a).", "success") setPlayerHudComponentVisible(player, "radar", true) triggerClientEvent(player, 'Schootz.RemoveLogin', player) setCameraTarget(player, player) fadeCamera(player, true) else exports['FR_DxMessagesLOGIN']:addBox(player, "Erro ao criar sua conta, contate a administração.", "error") end else exports['FR_DxMessagesLOGIN']:addBox(player, "Essa conta já existe.", "error") end else exports['FR_DxMessagesLOGIN']:addBox(player, "Você já registrou o máximo de contas possíveis.", "error") end else exports['FR_DxMessagesLOGIN']:addBox(player, "Não pode existir espaços no usuario e senha.", "error") end else exports['FR_DxMessagesLOGIN']:addBox(player, "Minimo de 4 caracteres para a senha e úsuario.", "error") end else exports['FR_DxMessagesLOGIN']:addBox(player, "Digite os dados corretamente.", "error") end end ) addEvent('Schootz.logar', true) addEventHandler('Schootz.logar', root, function (player, user, password, check) local account = getAccount(user, password) if account then logIn(player, account, password) triggerClientEvent(player, 'Schootz.saveLoginToXML', player, user, password) exports['FR_DxMessagesLOGIN']:addBox(player, "Logado com sucesso, Bem-vindo(a).", "success") setPlayerHudComponentVisible(player, "radar", true) setElementData(player, "BloquearHUD", false) setElementData(player, "BloquearHUD1", false) setCameraTarget(player, player) fadeCamera(player, true) triggerClientEvent(player, 'Schootz.RemoveLogin', player) else exports['FR_DxMessagesLOGIN']:addBox(player, "Essa conta não existe.", "error") end end) Link to comment
eqFoxim Posted January 11, 2023 Share Posted January 11, 2023 (edited) Ola HeyWeeknd boa noite! Existem 2 modos de tirar a hud, radar etc... Caso a hud e o radar forem modificados você tera que usar exports ou setElementData Ideia com ElementData : Na sua HUD, verifica se o elementData é true com getElementData, então renderiza ela No painel de login, ao player entrar seta o elementData como false, e depois que ele logar seta como true com o setElementData Assim quando o player estiver no login não ira aparecer a hud, quando ele logar a hud ira aparecer. Caso a hud ou radar forem padrão do jogo, você tera que usar setPlayerHudComponentVisible. Edited January 11, 2023 by eqFoxim Link to comment
HeyWeeknd Posted January 11, 2023 Author Share Posted January 11, 2023 Achei isso no hud local enabledHud = {"radar", "radio", "crosshair"} function showHud() if (isCustomHudEnabled()) then showPlayerHudComponent("all", false) for i,hud in ipairs(enabledHud) do showPlayerHudComponent(hud, true) end else showPlayerHudComponent("all", true) end end addEvent("GTIhud.showHud", true) addEventHandler("GTIhud.showHud", root, showHud) Como uso ? ta escrito --hud exports em cima Link to comment
Other Languages Moderators Lord Henry Posted January 11, 2023 Other Languages Moderators Share Posted January 11, 2023 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now