Jump to content

حل بسيط


Recommended Posts

--client


addEventHandler( "onClientGUIClick", root,
	function(  )
		if source == EmF1 then
			triggerServerEvent( "tServerE", localPlayer, "ttE1" )
		end
	end
)


function I1 ()
local myImage1 = dxCreateTexture( "Emoticons/EM1.png" )
	dxDrawImageOnElement( localPlayer, myImage1 )
end

addEvent( "startE1", true )
addEventHandler( "startE1", root,
	function()
		addEventHandler( "onClientRender", getRootElement(), I1 )
		setTimer( function()
		removeEventHandler( "onClientRender", getRootElement(), I1 )
		end, 5000, 1 )
	end
)
--server

addEvent( "tServerE", true )
addEventHandler( "tServerE", root,
function ( action ) 
for i, v in ipairs( getElementsByType( 'player' ) ) do
	if action == "ttE1" then
		triggerClientEvent( v, "startE1", v )
	end
end
end
)

 

 

ابي لما اللاعب يضغط زر

 

يجي فوق راسه صوره

يقدر يشوفها

 

واللي قدامي يضدر يشوفها بعد

 

كيف ؟

Link to comment

جرب ذا

addEventHandler( "onClientGUIClick", root,
	function(  )
		if source == EmF1 then
			setElementData ( localPlayer , "showImg" , not getElementData ( localPlayer , "showImg" ) )
		end
	end
)


local myImage1 = dxCreateTexture( "Emoticons/EM1.png" )


	addEventHandler ( "onClientRender" , root , 
	
	function (	)
	
	if getElementData ( localPlayer , "showImg" ) == true then
	
	for _ ,v in ipairs ( getElementsByType ( "player" ) ) do 
	
	dxDrawImageOnElement( localPlayer, myImage1 )

			end
		end
	end
	)
	

 

Link to comment
9 minutes ago, Abdul KariM said:

dxDrawImageOnElement

هذا الفنكشن جربته وما يزبط

Edited by Guest
Link to comment
20 hours ago, Abdul KariM said:

جرب ذا


addEventHandler( "onClientGUIClick", root,
	function(  )
		if source == EmF1 then
			setElementData ( localPlayer , "showImg" , not getElementData ( localPlayer , "showImg" ) )
		end
	end
)


local myImage1 = dxCreateTexture( "Emoticons/EM1.png" )


	addEventHandler ( "onClientRender" , root , 
	
	function (	)
	
	if getElementData ( localPlayer , "showImg" ) == true then
	
	for _ ,v in ipairs ( getElementsByType ( "player" ) ) do 
	
	dxDrawImageOnElement( localPlayer, myImage1 )

			end
		end
	end
	)
	

 

ما اشتغل

 

ابي الصوره تجي فوق راسي

بس اللي قدامي ييشوفها فوق راسي انا

 

Link to comment
function dxDrawImageOnElement(TheElement,Image,distance,height,width,R,G,B,alpha)
				local x, y, z = getElementPosition(TheElement)
				local x2, y2, z2 = getElementPosition(localPlayer)
				local distance = distance or 20
				local height = height or 1
				local width = width or 1
                                local checkBuildings = checkBuildings or true
                                local checkVehicles = checkVehicles or false
                                local checkPeds = checkPeds or false
                                local checkObjects = checkObjects or true
                                local checkDummies = checkDummies or true
                                local seeThroughStuff = seeThroughStuff or false
                                local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false
                                local ignoredElement = ignoredElement or nil
				if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then
					local sx, sy = getScreenFromWorldPosition(x, y, z+height)
					if(sx) and (sy) then
						local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)
						if(distanceBetweenPoints < distance) then
							dxDrawMaterialLine3D(x, y, z+1+height-(distanceBetweenPoints/distance), x, y, z+height, Image, width-(distanceBetweenPoints/distance), tocolor(R or 255, G or 255, B or 255, alpha or 255))
						end
					end
			end
	end
	
addEventHandler( "onClientGUIClick", root,
	function(  )
		if source == EmF1 then
			setElementData ( localPlayer , "showImg" , not getElementData ( localPlayer , "showImg" ) )
		end
	end
)


local myImage1 = dxCreateTexture( "Emoticons/EM1.png" )


	addEventHandler ( "onClientRender" , root , 
	
	function (	)
	
	
	for _ ,v in ipairs ( getElementsByType ( "player" ) ) do 
	if getElementData ( v , "showImg" ) == true then
	dxDrawImageOnElement( v, myImage1 )
	
			end
		end
	end
	)
	

 

  • Like 1
Link to comment

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