Sign in to follow this  
Kahinan

Me Ajudem Nessa HUD

Recommended Posts

Posted (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 by Kahinan

Share this post


Link to post
Posted (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 by Renazz

Share this post


Link to post
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.

Share this post


Link to post

Ai você é god, usando IsObjectInACLGroup no client

Share this post


Link to post
Posted (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 by Renazz

Share this post


Link to post
Posted (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 by Lord Henry

Share this post


Link to post
Posted (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 by Renazz

Share this post


Link to post
Posted (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 by Lord Henry

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post

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

Share this post


Link to post

@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.

Share this post


Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.