Sign in to follow this  
yasin0

x[مشكلة]x بالصورة

Recommended Posts

السلام عليكم

عندي مشكلة انه يتحقق بالسيريال لو اللاعب سيرياله صح تظهر الصورة فوقه ويشوفها الكل المشكلة الصورة تطلع لي حتى لو شلت السيريال

--server side
addEventHandler('onPlayerLogin',root,function()
if getPlayerSerial(source) == 'E7EF1AEEA73E5AD8CB4B1E6FCD30FF3' then 
setElementData(source,'serial')
end end )
--client side
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
	tag = dxCreateTexture("admin.png")
	addEventHandler("onClientPreRender",root,
	function ()
    for k,v in ipairs(getElementsByType("player")) do
	getElementData(localPlayer,'serial')
	dxDrawImageOnElement(v,tag)
	end  end )

 

Share this post


Link to post
--server side
addEventHandler( 'onPlayerLogin' , root , 
function()
	if ( getPlayerSerial( source ) == 'E7EF1AEEA73E5AD8CB4B1E6FCD30FF3' ) then 
		setElementData( source , 'showTag' )
	end
end
)
--client side
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
tag = dxCreateTexture( 'admin.png' )
addEventHandler( 'onClientPreRender' , root , 
function ( )
    for k , v in ipairs( getElementsByType("player") ) do
		isSuperPlayer = getElementData( localPlayer , 'showTag' )
		if ( isSuperPlayer ) then 
			dxDrawImageOnElement( v , tag )
		end
	end
end
)

	
	

على اساس ما فيها خطأ dxDrawImageOnElement  انا ما شفت اكواد وظيفة 

 (so Ez جرب الاكواد( مشكلتك 

Share this post


Link to post
1 hour ago, Debo15 said:

--server side
addEventHandler( 'onPlayerLogin' , root , 
function()
	if ( getPlayerSerial( source ) == 'E7EF1AEEA73E5AD8CB4B1E6FCD30FF3' ) then 
		setElementData( source , 'showTag' )
	end
end
)
--client side
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
tag = dxCreateTexture( 'admin.png' )
addEventHandler( 'onClientPreRender' , root , 
function ( )
    for k , v in ipairs( getElementsByType("player") ) do
		isSuperPlayer = getElementData( localPlayer , 'showTag' )
		if ( isSuperPlayer ) then 
			dxDrawImageOnElement( v , tag )
		end
	end
end
)

	
	

على اساس ما فيها خطأ dxDrawImageOnElement  انا ما شفت اكواد وظيفة 

 (so Ez جرب الاكواد( مشكلتك 

لا تظهر الصورة كما يوجد ارجمنت ناقص وهو الداتا يقول الثالث none

Share this post


Link to post
37 minutes ago, yasin0 said:

لا تظهر الصورة كما يوجد ارجمنت ناقص وهو الداتا يقول الثالث none

جرب بطريقة التريقر 

هي تسوي لاق اقل 

--server side
addEventHandler( 'onPlayerLogin' , root , 
function()
	if ( getPlayerSerial( source ) == 'E7EF1AEEA73E5AD8CB4B1E6FCD30FF3' ) then 
		triggerClientEvent ( root , 'showTag', source )
	end
end
)
--client side
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

tag = dxCreateTexture( 'admin.png' )

addEvent( 'showTag' , true )
function showTag ( )
	dxDrawImageOnElement( source , tag , 20 , 30 , 30 )
end
addEventHandler( 'showTag' , root , showTag )

	
	

الكود مو مجرب

Share this post


Link to post
14 hours ago, Debo15 said:

جرب بطريقة التريقر 

هي تسوي لاق اقل 


--server side
addEventHandler( 'onPlayerLogin' , root , 
function()
	if ( getPlayerSerial( source ) == 'E7EF1AEEA73E5AD8CB4B1E6FCD30FF3' ) then 
		triggerClientEvent ( root , 'showTag', source )
	end
end
)
--client side
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

tag = dxCreateTexture( 'admin.png' )

addEvent( 'showTag' , true )
function showTag ( )
	dxDrawImageOnElement( source , tag , 20 , 30 , 30 )
end
addEventHandler( 'showTag' , root , showTag )

	
	

الكود مو مجرب

مايشتغل مع عدم وجود اخطاء

Share this post


Link to post

جرب هذا

--server side
addEventHandler('onPlayerLogin',root,

	function (	)

	if getPlayerSerial ( source ) == 'E7EF1AEEA73E5AD8CB4B1E6FCD30FF3' then 

	setElementData( source ,'serial', true )

		end 
	end
	)
	

	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
	
	tag = dxCreateTexture("admin.png")
	
addEventHandler("onClientPreRender",root,

	function (	)
	
	for k,v in ipairs ( getElementsByType ( "player" ) ) do
	
	if getElementData ( v ,'serial' ) == true then
	
	dxDrawImageOnElement( v , tag )
	
			end
		end
	end 
	)
	
	
	
	
	
	
	
	
	

 

  • Like 1

Share this post


Link to post
20 hours ago, Abdul KariM said:

جرب هذا


--server side
addEventHandler('onPlayerLogin',root,

	function (	)

	if getPlayerSerial ( source ) == 'E7EF1AEEA73E5AD8CB4B1E6FCD30FF3' then 

	setElementData( source ,'serial', true )

		end 
	end
	)
	

	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
	
	tag = dxCreateTexture("admin.png")
	
addEventHandler("onClientPreRender",root,

	function (	)
	
	for k,v in ipairs ( getElementsByType ( "player" ) ) do
	
	if getElementData ( v ,'serial' ) == true then
	
	dxDrawImageOnElement( v , tag )
	
			end
		end
	end 
	)
	
	
	
	
	
	
	
	
	

 

يعطيك العافية سؤال : اشرح لي كيف سويته ووش اخطائي

Share this post


Link to post

@yasin0 كان في عندك غلط نسيت تحط الارقمنت الثالث للداتا 

وعندك جهة كلينت ماسويت تحقق بالطريقة الصحيحة

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.