Jaga Posted May 19, 2019 Share Posted May 19, 2019 (edited) local screenW, screenH = guiGetScreenSize() addEventHandler("onClientRender", root, function () local Dinheiro_Mao = getPlayerMoney ( localPlayer ) local Dinheiro_Banco = getElementData ( localPlayer, "Bank:Caixa" ) or 0 dxDrawImage(screenW * 0.6504, screenH * 0.0130, screenW * 0.3398, screenH * 0.2344, ":[BVN]HUD2/hud.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("R$", screenW * 0.8193, screenH * 0.0482, screenW * 0.8408, screenH * 0.0742, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("R$", screenW * 0.8193, screenH * 0.1224, screenW * 0.8408, screenH * 0.1484, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText(""..Dinheiro_Mao, screenW * 0.8408, screenH * 0.1224, screenW * 0.9434, screenH * 0.1497, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText(""..Dinheiro_Banco, screenW * 0.8408, screenH * 0.0482, screenW * 0.9434, screenH * 0.0755, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Cidadao", screenW * 0.8193, screenH * 0.1966, screenW * 0.9219, screenH * 0.2240, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) end ) Eu Fiz Uma Hud Onde Ela Esta Pegando Perfeitamente Mas Queria Saber Como Coloca Cargos Tipo Na ACL "Everyone" Iria Aparecer Na Hud O Cargo Cidadao Alguem Poderia Me Ajudar Nisso ? Edited May 19, 2019 by Kahinan Link to comment
Renaz Posted May 19, 2019 Share Posted May 19, 2019 (edited) function setCargo(player) if player then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("Acl")) then -- Nome da ACL setElementData(player, "Cargo", "Nome do Cargo") -- Aparecerá na HUD end end end Crie um arquivo server e cole este código. local screenW, screenH = guiGetScreenSize() addEventHandler("onClientRender", root, function () local Dinheiro_Mao = getPlayerMoney ( localPlayer ) local Dinheiro_Banco = getElementData ( localPlayer, "Bank:Caixa" ) or 0 dxDrawImage(screenW * 0.6504, screenH * 0.0130, screenW * 0.3398, screenH * 0.2344, ":[BVN]HUD2/hud.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("R$", screenW * 0.8193, screenH * 0.0482, screenW * 0.8408, screenH * 0.0742, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("R$", screenW * 0.8193, screenH * 0.1224, screenW * 0.8408, screenH * 0.1484, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText(""..Dinheiro_Mao, screenW * 0.8408, screenH * 0.1224, screenW * 0.9434, screenH * 0.1497, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText(""..Dinheiro_Banco, screenW * 0.8408, screenH * 0.0482, screenW * 0.9434, screenH * 0.0755, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("..Cargo..", screenW * 0.8193, screenH * 0.1966, screenW * 0.9219, screenH * 0.2240, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) end ) e aqui está a parte do arquivo client Edited May 19, 2019 by Renazz Link to comment
Other Languages Moderators Lord Henry Posted May 19, 2019 Other Languages Moderators Share Posted May 19, 2019 2 minutes ago, Renazz said: local screenW, screenH = guiGetScreenSize() addEventHandler("onClientRender", root, function () local Dinheiro_Mao = getPlayerMoney ( localPlayer ) local Dinheiro_Banco = getElementData ( localPlayer, "Bank:Caixa" ) or 0 dxDrawImage(screenW * 0.6504, screenH * 0.0130, screenW * 0.3398, screenH * 0.2344, ":[BVN]HUD2/hud.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("R$", screenW * 0.8193, screenH * 0.0482, screenW * 0.8408, screenH * 0.0742, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("R$", screenW * 0.8193, screenH * 0.1224, screenW * 0.8408, screenH * 0.1484, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText(""..Dinheiro_Mao, screenW * 0.8408, screenH * 0.1224, screenW * 0.9434, screenH * 0.1497, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText(""..Dinheiro_Banco, screenW * 0.8408, screenH * 0.0482, screenW * 0.9434, screenH * 0.0755, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("..Cargo..", screenW * 0.8193, screenH * 0.1966, screenW * 0.9219, screenH * 0.2240, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) end ) function setCargo(player) if player then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("Acl")) then -- Nome da ACL setElementData(player, "Cargo", "Nome do Cargo") -- Aparecerá na HUD end end end faça deste jeito, se quiser colocar mais só copiar e colocar da linha 18 á 19. espero ter ajudado, se ajudei não esquece de dar um tanks! Isto é impossível de ser feito. Você não pode colocar funções client-side e funções server-side no mesmo script. Somente se as funções forem both-side. Link to comment
Jonas^ Posted May 19, 2019 Share Posted May 19, 2019 Ai você é god, usando IsObjectInACLGroup no client Link to comment
Renaz Posted May 19, 2019 Share Posted May 19, 2019 (edited) 3 minutes ago, Lord Henry said: Isto é impossível de ser feito. Você não pode colocar funções client-side e funções server-side no mesmo script. Somente se as funções forem both-side. corrigido! Edited May 19, 2019 by Renazz Link to comment
Other Languages Moderators Lord Henry Posted May 19, 2019 Other Languages Moderators Share Posted May 19, 2019 (edited) Ok, ainda está com erros. Na sua parte server, a função precisa ser chamada em algum lugar ou de um evento ativador, caso contrário ela é uma função inútil. Na sua parte cliente, não existe nenhum lugar chamando aquele elementData que vc definiu no server, vc está apenas mostrando um texto ..Cargo.. 20 minutes ago, Renazz said: function setCargo(player) if player then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("Acl")) then -- Nome da ACL setElementData(player, "Cargo", "Nome do Cargo") -- Aparecerá na HUD end end end Crie um arquivo server e cole este código. local screenW, screenH = guiGetScreenSize() addEventHandler("onClientRender", root, function () local Dinheiro_Mao = getPlayerMoney ( localPlayer ) local Dinheiro_Banco = getElementData ( localPlayer, "Bank:Caixa" ) or 0 dxDrawImage(screenW * 0.6504, screenH * 0.0130, screenW * 0.3398, screenH * 0.2344, ":[BVN]HUD2/hud.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("R$", screenW * 0.8193, screenH * 0.0482, screenW * 0.8408, screenH * 0.0742, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("R$", screenW * 0.8193, screenH * 0.1224, screenW * 0.8408, screenH * 0.1484, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText(""..Dinheiro_Mao, screenW * 0.8408, screenH * 0.1224, screenW * 0.9434, screenH * 0.1497, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText(""..Dinheiro_Banco, screenW * 0.8408, screenH * 0.0482, screenW * 0.9434, screenH * 0.0755, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("..Cargo..", screenW * 0.8193, screenH * 0.1966, screenW * 0.9219, screenH * 0.2240, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) end ) e aqui está a parte do arquivo client Edited May 19, 2019 by Lord Henry Link to comment
Renaz Posted May 19, 2019 Share Posted May 19, 2019 (edited) local screenW, screenH = guiGetScreenSize() addEventHandler("onClientRender", root, function () local Dinheiro_Mao = getPlayerMoney ( localPlayer ) local Dinheiro_Banco = getElementData ( localPlayer, "Bank:Caixa" ) or 0 local Cargo = getElementData("Cargo",localPlayer) dxDrawImage(screenW * 0.6504, screenH * 0.0130, screenW * 0.3398, screenH * 0.2344, ":[BVN]HUD2/hud.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("R$", screenW * 0.8193, screenH * 0.0482, screenW * 0.8408, screenH * 0.0742, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("R$", screenW * 0.8193, screenH * 0.1224, screenW * 0.8408, screenH * 0.1484, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText(""..Dinheiro_Mao, screenW * 0.8408, screenH * 0.1224, screenW * 0.9434, screenH * 0.1497, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText(""..Dinheiro_Banco, screenW * 0.8408, screenH * 0.0482, screenW * 0.9434, screenH * 0.0755, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText(""..Cargo, screenW * 0.8193, screenH * 0.1966, screenW * 0.9219, screenH * 0.2240, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) end ) no caso o client ficaria assim? Edited May 19, 2019 by Renazz Link to comment
Other Languages Moderators Lord Henry Posted May 19, 2019 Other Languages Moderators Share Posted May 19, 2019 (edited) Preste atenção na linha 13. Vc está testando isso que vc está fazendo? Ou está fazendo de qualquer jeito achando que funciona? Edited May 19, 2019 by Lord Henry Link to comment
Renaz Posted May 19, 2019 Share Posted May 19, 2019 2 minutes ago, Lord Henry said: Vc está testando isso que vc está fazendo? não. 3 minutes ago, Lord Henry said: Ou está fazendo de qualquer jeito achando que funciona? não estou fazendo de qualquer jeito. Link to comment
Jaga Posted May 19, 2019 Author Share Posted May 19, 2019 55 minutes ago, Renazz said: function setCargo(player) if player then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("Acl")) then -- Nome da ACL setElementData(player, "Cargo", "Nome do Cargo") -- Aparecerá na HUD end end end Crie um arquivo server e cole este código. local screenW, screenH = guiGetScreenSize() addEventHandler("onClientRender", root, function () local Dinheiro_Mao = getPlayerMoney ( localPlayer ) local Dinheiro_Banco = getElementData ( localPlayer, "Bank:Caixa" ) or 0 dxDrawImage(screenW * 0.6504, screenH * 0.0130, screenW * 0.3398, screenH * 0.2344, ":[BVN]HUD2/hud.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("R$", screenW * 0.8193, screenH * 0.0482, screenW * 0.8408, screenH * 0.0742, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("R$", screenW * 0.8193, screenH * 0.1224, screenW * 0.8408, screenH * 0.1484, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText(""..Dinheiro_Mao, screenW * 0.8408, screenH * 0.1224, screenW * 0.9434, screenH * 0.1497, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText(""..Dinheiro_Banco, screenW * 0.8408, screenH * 0.0482, screenW * 0.9434, screenH * 0.0755, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("..Cargo..", screenW * 0.8193, screenH * 0.1966, screenW * 0.9219, screenH * 0.2240, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) end ) e aqui está a parte do arquivo client Nao Pegou Eu Fiz Tudo Certinho Mas Nao Foi Link to comment
Eficiencia Posted May 19, 2019 Share Posted May 19, 2019 Na sua linha 13 tem um erro local screenW, screenH = guiGetScreenSize() addEventHandler("onClientRender", root, function () local Dinheiro_Mao = getPlayerMoney ( localPlayer ) local Dinheiro_Banco = getElementData ( localPlayer, "Bank:Caixa" ) or 0 dxDrawImage(screenW * 0.6504, screenH * 0.0130, screenW * 0.3398, screenH * 0.2344, ":[BVN]HUD2/hud.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("R$", screenW * 0.8193, screenH * 0.0482, screenW * 0.8408, screenH * 0.0742, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("R$", screenW * 0.8193, screenH * 0.1224, screenW * 0.8408, screenH * 0.1484, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText(""..Dinheiro_Mao, screenW * 0.8408, screenH * 0.1224, screenW * 0.9434, screenH * 0.1497, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText(""..Dinheiro_Banco, screenW * 0.8408, screenH * 0.0482, screenW * 0.9434, screenH * 0.0755, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText(""..Cargo.., screenW * 0.8193, screenH * 0.1966, screenW * 0.9219, screenH * 0.2240, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) end ) vou tentar arrumar pra vc Client local screenW, screenH = guiGetScreenSize() addEventHandler("onClientRender", root, function () local Dinheiro_Mao = getPlayerMoney ( localPlayer ) local Dinheiro_Banco = getElementData ( localPlayer, "Bank:Caixa" ) or 0 local Cargo = getElementData(localPlayer, "Cargo" ) dxDrawImage(screenW * 0.6504, screenH * 0.0130, screenW * 0.3398, screenH * 0.2344, ":[BVN]HUD2/hud.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("R$", screenW * 0.8193, screenH * 0.0482, screenW * 0.8408, screenH * 0.0742, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("R$", screenW * 0.8193, screenH * 0.1224, screenW * 0.8408, screenH * 0.1484, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText(""..Dinheiro_Mao, screenW * 0.8408, screenH * 0.1224, screenW * 0.9434, screenH * 0.1497, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText(""..Dinheiro_Banco, screenW * 0.8408, screenH * 0.0482, screenW * 0.9434, screenH * 0.0755, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) dxDrawText(""..Cargo, screenW * 0.8193, screenH * 0.1966, screenW * 0.9219, screenH * 0.2240, tocolor(255, 255, 255, 255), 1.10, "default-bold", "left", "top", false, false, false, false, false) end) Server function setCargo(source) if player then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("Acl")) then -- Nome da ACL setElementData(source, "Cargo") end end end EDIT:Não testado Link to comment
Renaz Posted May 19, 2019 Share Posted May 19, 2019 54 minutes ago, Eficiencia said: if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("Acl")) then -- Nome da ACL setElementData(source, "Cargo") e quando o player for setado na acl não aparecerá nada na hud, voce não atribui um nome do cargo para aquela acl Link to comment
DNL291 Posted May 19, 2019 Share Posted May 19, 2019 @Renazz Erros básicos você cometeu e quer ajudar o dono do tópico como? Deixe isso pra quem tem tal conhecimento e evite causar confusão em quem está precisando de ajuda. Toda ajuda é boa e ajuda a pessoa a progredir, mas assim você só está atrapalhando no tópico, além disso não é com códigos prontos que se ensina, muito menos com códigos prontos com erros bizarros pra quem sabe fazer scripts. 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