Jump to content

فنكشن


#TeKa

Recommended Posts

Just now, N3xT said:

^ ذا الكود من الويكي, لذلك من الطبيعي راح يكون صحيح

لكن لازم تحط معاه السورس كود عشان يشتغل, وتتأكد هل عندك صوره بذا الإسم

كيف احط السورس ؟؟ و وين السورس 

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

 

Link to comment
Just now, N3xT said:

حطه فوق الكود

 


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

 

مغيرش اي حاجه فيه ؟؟ احطو كدا من غير ما اغير حاجه ؟؟

Link to comment
On ٣‏/٨‏/٢٠١٥ at 3:24 PM, iMr.SFA7 said:
# ZA7F = ; said:

marker لا تنسى تضع اسم الصورة ومسارها الصحيح .. ولا تنسى بـ السطر الرابع اسم الماركر بدال

 



local Url = "Image.png" --- اسسم الصورة هنا 
  
addEventHandler( "onClientRender", root, function (  ) 
       local x, y, z = getElementPosition( marker ) 
       local Mx, My, Mz = getCameraMatrix(   ) 
        if ( getDistanceBetweenPoints3D( x, y, z, Mx, My, Mz ) <= 15 ) then 
           local WorldPositionX, WorldPositionY = getScreenFromWorldPosition( x, y, z +1, 0.07 ) 
            if ( WorldPositionX and WorldPositionY ) then 
               dxDrawImage( WorldPositionX, WorldPositionY, WorldPositionX, WorldPositionY, Url ) 
          end 
      end 
end ) 
 

 

Link to comment

حطيطو بس ما ظبط 
الاكواد اهي 
 

--Marker
local fahdmarker = createMarker (1158.4013671875 , -2062.08203125, 69.0078125-1,"cylinder", 1.1, 0, 255, 0)
tag = dxCreateTexture("9.png")
--Element
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
--Markericon
addEventHandler("onClientPreRender", root,
function()
dxDrawImageOnElement(fahdmarker,tag)
end)
--69

 

Just now, Professional said:

 

حطيطو اشتغل تمام
بس الصورة مش فوق الماركر بظبط 
و حجم الصورة كبيرا اوي 

Link to comment
Just now, #TeKa said:

حطيطو بس ما ظبط 
الاكواد اهي 
 


--Marker
local fahdmarker = createMarker (1158.4013671875 , -2062.08203125, 69.0078125-1,"cylinder", 1.1, 0, 255, 0)
tag = dxCreateTexture("9.png")
--Element
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
--Markericon
addEventHandler("onClientPreRender", root,
function()
dxDrawImageOnElement(fahdmarker,tag)
end)
--69

 

حطيطو اشتغل تمام
بس الصورة مش فوق الماركر بظبط 
و حجم الصورة كبيرا اوي 

مفيش رد حل يا جدعان 

Link to comment
Just now, N3xT said:

الكود مافيه خطأ, تأكد من مسار الصورة وهل أضفتها للميتا ؟

الصورة بتظهر و كلو تمام
ولكن 
الصورة كبيرا اوي
بتظهرلي كبيرا 
و مش مش مظبوطة علي الماركر
و لما امشي الصورة تمشي ورايا

Link to comment

جرب ذا

 

local fahdmarker = createMarker (1158.4013671875 , -2062.08203125, 69.0078125-1,"cylinder", 1.1, 0, 255, 0)
tag = dxCreateTexture("9.png")


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("onClientRender", root,
	function()
		if fahdmarker then
			dxDrawImageOnElement(fahdmarker,tag,20,1,10)
		end
	end
)

 

Link to comment
Just now, N3xT said:

جرب ذا

 


local fahdmarker = createMarker (1158.4013671875 , -2062.08203125, 69.0078125-1,"cylinder", 1.1, 0, 255, 0)
tag = dxCreateTexture("9.png")


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("onClientRender", root,
	function()
		if fahdmarker then
			dxDrawImageOnElement(fahdmarker,tag,20,1,10)
		end
	end
)

 

ما ظهرت الصورة و مفيش حاجه بتجيلي في الدي بج 

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