#TeKa Posted December 30, 2016 Share Posted December 30, 2016 السلام عليكم عايز فنكشن صورة فوق الماركر مثلا اول لما اقرب من الماركر يظهر صوره فوق الماركر بظبط !! و ياريت تقلولي ارتب الفنكشن ازاي Link to comment
N3xT Posted December 30, 2016 Share Posted December 30, 2016 https://wiki.multitheftauto.com/wiki/DxDrawImageOnElement Link to comment
#TeKa Posted December 30, 2016 Author Share 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) Link to comment
N3xT Posted December 30, 2016 Share Posted December 30, 2016 ^ ذا الكود من الويكي, لذلك من الطبيعي راح يكون صحيح لكن لازم تحط معاه السورس كود عشان يشتغل, وتتأكد هل عندك صوره بذا الإسم Link to comment
#TeKa Posted December 30, 2016 Author Share Posted December 30, 2016 Just now, N3xT said: ^ ذا الكود من الويكي, لذلك من الطبيعي راح يكون صحيح لكن لازم تحط معاه السورس كود عشان يشتغل, وتتأكد هل عندك صوره بذا الإسم كيف احط السورس ؟؟ و وين السورس Link to comment
N3xT Posted December 30, 2016 Share 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 Link to comment
#TeKa Posted December 30, 2016 Author Share 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 مغيرش اي حاجه فيه ؟؟ احطو كدا من غير ما اغير حاجه ؟؟ Link to comment
N3xT Posted December 30, 2016 Share Posted December 30, 2016 يب وأستعمل الكود اللي فالبداية عطيتني هو Link to comment
Professional Posted December 30, 2016 Share 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 ) Link to comment
#TeKa Posted December 30, 2016 Author Share 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: حطيطو اشتغل تمام بس الصورة مش فوق الماركر بظبط و حجم الصورة كبيرا اوي Link to comment
#TeKa Posted December 30, 2016 Author Share 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 حطيطو اشتغل تمام بس الصورة مش فوق الماركر بظبط و حجم الصورة كبيرا اوي مفيش رد حل يا جدعان Link to comment
N3xT Posted December 30, 2016 Share Posted December 30, 2016 الكود مافيه خطأ, تأكد من مسار الصورة وهل أضفتها للميتا ؟ Link to comment
#TeKa Posted December 30, 2016 Author Share Posted December 30, 2016 Just now, N3xT said: الكود مافيه خطأ, تأكد من مسار الصورة وهل أضفتها للميتا ؟ الصورة بتظهر و كلو تمام ولكن الصورة كبيرا اوي بتظهرلي كبيرا و مش مش مظبوطة علي الماركر و لما امشي الصورة تمشي ورايا Link to comment
N3xT Posted December 30, 2016 Share 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 ) Link to comment
#TeKa Posted December 30, 2016 Author Share 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 ) ما ظهرت الصورة و مفيش حاجه بتجيلي في الدي بج Link to comment
F_F Posted December 30, 2016 Share Posted December 30, 2016 الصورة الي عندك كبيرة صغرها من الرسام او اي موقع لتصغير الحجم Link to comment
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