Jump to content

Ajuda Titulo pickup


Recommended Posts

  • Moderators
Posted

Sim é possível.

Veja como é feito neste resource antigo de taxista:

https://community.multitheftauto.com/index.php?p=resources&s=details&id=14561

Eu te ajudei ou achou meu comentário útil? Não esqueça de deixar um Thanks! spacer.png

Minhas contribuições para a comunidade: LordHenry - MTA Wiki Profile
Inscreva-se no meu canal do YouTube: Lord Henry - Entertainment
Discord Oficial do MTA: https://mtasa.com/discord
Blacklist e Whitelist de Scripters: Planilha

Por favor, não me envie mensagens privadas solicitando suporte. Crie um tópico no fórum em vez disso.

Posted

Consegui fazer funcionar não.

thePickup = createPickup (  1914.3330078125, -1806.919921875, 13.546875, 3, 1275, 1000 )
function zombiehunterskinpickup55555 ( thePlayer )
  dxDrawTextOnElement(zombiehunterskinpickup55555,"Roupas #FF0000(CJ)",1,20,255,255,255,255,1.5,"default")
		end
		
	
 --setElementData ( thePlayer, "zombie", true  )  
 --outputChatBox("Pegou os equipamentos da PD.", thePlayer)
 
end
addEventHandler ( "onPickupUse", thePickup, zombiehunterskinpickup55555 )

local bInfos =
{

	{ vecPos = { 1915.35, -1802.22, 13.54 }, sText = "Teste: Taxista", iColor = tocolor( 255, 255, 0, 255 ), fDistance = 20, fScale = 1.02, sFont = "default" };
	
};

function Render()
	for _, Data in pairs( bInfos ) do
		local fPosX, fPosY, fPosZ		= getElementPosition( localPlayer );
		local fDataX, fDataY, fDataZ 	= unpack( Data.vecPos );
		local fDistanceBetweenPoints	= getDistanceBetweenPoints3D ( fPosX, fPosY, fPosZ,fDataX, fDataY, fDataZ );
		local fInputDistance			= Data.fDistance or 20;
		if fDistanceBetweenPoints < fInputDistance then
			local fCameraX, fCameraY, fCameraZ 	= getCameraMatrix();
			local fWorldPosX, fWorldPosY 		= getScreenFromWorldPosition( fDataX, fDataY, fDataZ + 1, fInputDistance );
			local bHit  						= processLineOfSight( fCameraX, fCameraY, fCameraZ, fDataX, fDataY, fDataZ, true, false, false, true, false, false, false, false );
			if not bHit then
				if fWorldPosX and fWorldPosY then
					dxDrawText( 
						Data.sText,
						fWorldPosX,
						fWorldPosY,
						fWorldPosX,
						fWorldPosY,
						Data.iColor,
						Data.fScale,
						Data.sFont
					);
				end	
			end	
		end
	end
end
addEventHandler( "onClientRender", root, Render );

 

Consegui, Tópico já pode ser fechado, obrigado ao Henry pela ajuda.

Posted
1 hour ago, Lord Henry said:

Sim é possível.

Veja como é feito neste resource antigo de taxista:

https://community.multitheftauto.com/index.php?p=resources&s=details&id=14561

Irmão estou com um problema agora, como faço para setar dimensão e interior desse texto ? não estou conseguindo.

local bInfos =
{
    
	{ vecPos = { 1909.0849609375, -1805.919921875, 13.546875 }, sText = "Teste: Taxista", iColor = tocolor( 255, 255, 0, 255 ), fDistance = 20, fScale = 2.02, sFont = "default" };
	{ vecPos = { 1909.1171875, -1808.9482421875, 13.546875 }, sText = "Teste: Taxista", iColor = tocolor( 255, 255, 0, 255 ), fDistance = 20, fScale = 1.02, sFont = "default" };
	
}; 

function Render()
	for _, Data in pairs( bInfos ) do
		local fPosX, fPosY, fPosZ		= getElementPosition( localPlayer );
		local fDataX, fDataY, fDataZ 	= unpack( Data.vecPos );
		local fDistanceBetweenPoints	= getDistanceBetweenPoints3D ( fPosX, fPosY, fPosZ,fDataX, fDataY, fDataZ );
		local fInputDistance			= Data.fDistance or 20;
		if fDistanceBetweenPoints < fInputDistance then
			local fCameraX, fCameraY, fCameraZ 	= getCameraMatrix();
			local fWorldPosX, fWorldPosY 		= getScreenFromWorldPosition( fDataX, fDataY, fDataZ + 1, fInputDistance );
			local bHit  						= processLineOfSight( fCameraX, fCameraY, fCameraZ, fDataX, fDataY, fDataZ, true, false, false, true, false, false, false, false );
			if not bHit then
				if fWorldPosX and fWorldPosY then
					dxDrawText( 
						Data.sText,
						fWorldPosX,
						fWorldPosY,
						fWorldPosX,
						fWorldPosY,
						Data.iColor,
						Data.fScale,
						Data.sFont
					);
				end	
			end	
		end
	end
end
addEventHandler( "onClientRender", root, Render );

 

  • Moderators
Posted
function Render()
	if (getElementDimension (localPlayer) == 5) and (getElementInterior (localPlayer) == 10) then -- Substitua o 5 e o 10 pela dimensão e interior respectivamente.
		for _, Data in pairs( bInfos ) do
			local fPosX, fPosY, fPosZ		= getElementPosition( localPlayer );
			local fDataX, fDataY, fDataZ 	= unpack( Data.vecPos );
			local fDistanceBetweenPoints	= getDistanceBetweenPoints3D ( fPosX, fPosY, fPosZ,fDataX, fDataY, fDataZ );
			local fInputDistance			= Data.fDistance or 20;
			if fDistanceBetweenPoints < fInputDistance then
				local fCameraX, fCameraY, fCameraZ 	= getCameraMatrix();
				local fWorldPosX, fWorldPosY 		= getScreenFromWorldPosition( fDataX, fDataY, fDataZ + 1, fInputDistance );
				local bHit  						= processLineOfSight( fCameraX, fCameraY, fCameraZ, fDataX, fDataY, fDataZ, true, false, false, true, false, false, false, false );
				if not bHit then
					if fWorldPosX and fWorldPosY then
						dxDrawText( 
							Data.sText,
							fWorldPosX,
							fWorldPosY,
							fWorldPosX,
							fWorldPosY,
							Data.iColor,
							Data.fScale,
							Data.sFont
						);
					end
				end	
			end	
		end
	end
end
addEventHandler ("onClientRender", root, Render)

Só fazer assim.

Eu te ajudei ou achou meu comentário útil? Não esqueça de deixar um Thanks! spacer.png

Minhas contribuições para a comunidade: LordHenry - MTA Wiki Profile
Inscreva-se no meu canal do YouTube: Lord Henry - Entertainment
Discord Oficial do MTA: https://mtasa.com/discord
Blacklist e Whitelist de Scripters: Planilha

Por favor, não me envie mensagens privadas solicitando suporte. Crie um tópico no fórum em vez disso.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...