#TeKa Posted December 30, 2016 Posted December 30, 2016 السلام عليكم عايز فنكشن صورة فوق الماركر مثلا اول لما اقرب من الماركر يظهر صوره فوق الماركر بظبط !! و ياريت تقلولي ارتب الفنكشن ازاي
N3xT Posted December 30, 2016 Posted December 30, 2016 https://wiki.multitheftauto.com/wiki/DxDrawImageOnElement
#TeKa Posted December 30, 2016 Author Posted December 30, 2016 Just now, N3xT said: https://wiki.multitheftauto.com/wiki/DxDrawImageOnElement هو ده الكود صح randomPed = createPed(285,2506.83423,-1684.89941,13.55648) tag = dxCreateTexture("crown.png") addEventHandler("onClientPreRender", root, function() dxDrawImageOnElement(randomPed,tag) end)
N3xT Posted December 30, 2016 Posted December 30, 2016 ^ ذا الكود من الويكي, لذلك من الطبيعي راح يكون صحيح لكن لازم تحط معاه السورس كود عشان يشتغل, وتتأكد هل عندك صوره بذا الإسم
#TeKa Posted December 30, 2016 Author Posted December 30, 2016 Just now, N3xT said: ^ ذا الكود من الويكي, لذلك من الطبيعي راح يكون صحيح لكن لازم تحط معاه السورس كود عشان يشتغل, وتتأكد هل عندك صوره بذا الإسم كيف احط السورس ؟؟ و وين السورس
N3xT Posted December 30, 2016 Posted December 30, 2016 حطه فوق الكود 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
#TeKa Posted December 30, 2016 Author Posted December 30, 2016 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 مغيرش اي حاجه فيه ؟؟ احطو كدا من غير ما اغير حاجه ؟؟
Professional Posted December 30, 2016 Posted December 30, 2016 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 )
#TeKa Posted December 30, 2016 Author Posted December 30, 2016 حطيطو بس ما ظبط الاكواد اهي --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: حطيطو اشتغل تمام بس الصورة مش فوق الماركر بظبط و حجم الصورة كبيرا اوي
#TeKa Posted December 30, 2016 Author Posted December 30, 2016 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 حطيطو اشتغل تمام بس الصورة مش فوق الماركر بظبط و حجم الصورة كبيرا اوي مفيش رد حل يا جدعان
N3xT Posted December 30, 2016 Posted December 30, 2016 الكود مافيه خطأ, تأكد من مسار الصورة وهل أضفتها للميتا ؟
#TeKa Posted December 30, 2016 Author Posted December 30, 2016 Just now, N3xT said: الكود مافيه خطأ, تأكد من مسار الصورة وهل أضفتها للميتا ؟ الصورة بتظهر و كلو تمام ولكن الصورة كبيرا اوي بتظهرلي كبيرا و مش مش مظبوطة علي الماركر و لما امشي الصورة تمشي ورايا
N3xT Posted December 30, 2016 Posted December 30, 2016 جرب ذا 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 )
#TeKa Posted December 30, 2016 Author Posted December 30, 2016 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 ) ما ظهرت الصورة و مفيش حاجه بتجيلي في الدي بج
F_F Posted December 30, 2016 Posted December 30, 2016 الصورة الي عندك كبيرة صغرها من الرسام او اي موقع لتصغير الحجم
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now