iMr.G[7]A Posted March 20, 2014 Share Posted March 20, 2014 ابي الكود او المود اللي مثلا: سويت ماركر سيارات تدخل تاخذ سياره المهم ابيه مود اكتب فوق الماركر يعني اجي اشوف الماركر مكتوب فوقه سيارات اسطورة الـ زومبي Link to comment
ayman1998 Posted March 20, 2014 Share Posted March 20, 2014 حمل هاد https://community.multitheftauto.com/in ... ls&id=7613 شوف الشرح https://wiki.multitheftauto.com/wiki/Res ... Draw3DText Link to comment
iMr.G[7]A Posted March 20, 2014 Author Share Posted March 20, 2014 --[[ // DX 3D Texts By : 彡ṔĄ!И ( version : 1.0 ) / Script : client.lua --------------------------------------------- // Visit Us At : [url=http://www.Gta-Arabs.net]http://www.Gta-Arabs.net[/url] ^^ --]] -- making a table with allowed fonts' names local fonts = { [ "default" ] = true, [ "default-bold" ] = true,[ "clear" ] = true,[ "arial" ] = true,[ "sans" ] = true, [ "pricedown" ] = true, [ "bankgothic" ] = true,[ "diploma" ] = true,[ "beckett" ] = true }; function dxDraw3DText( text, x, y, z, scale, font, r, g, b, maxDistance ) -- checking required arguments assert( type( text ) == "string", "Bad argument @ dxDraw3DText" ); assert( type( x ) == "number", "Bad argument @ dxDraw3DText" ); assert( type( y ) == "number", "Bad argument @ dxDraw3DText" ); assert( type( z ) == "number", "Bad argument @ dxDraw3DText" ); -- checking optional arguments if not scale or type( scale ) ~= "number" or scale <= 0 then scale = 2 end if not font or type( font ) ~= "string" or not fonts[ font ] then font = "default" end if not r or type( r ) ~= "number" or r < 0 or r > 255 then r = 255 end if not g or type( g ) ~= "number" or g < 0 or g > 255 then g = 255 end if not b or type( b ) ~= "number" or b < 0 or b > 255 then b = 255 end if not maxDistance or type( maxDistance ) ~= "number" or maxDistance <= 1 then maxDistance = 12 end local textElement = createElement( "text" ); -- checking if the element was created if textElement then -- setting the element datas setElementData( textElement, "text", text ); setElementData( textElement, "x", x ); setElementData( textElement, "y", y ); setElementData( textElement, "z", z ); setElementData( textElement, "scale", scale ); setElementData( textElement, "font", font ); setElementData( textElement, "rgba", { r, g, b, 255 } ); setElementData( textElement, "maxDistance", maxDistance ); -- returning the text element return textElement end -- returning false in case of errors return false end addEventHandler( "onClientRender", root, function( ) local texts = getElementsByType( "text" ); if #texts > 0 then local pX, pY, pZ = getElementPosition( localPlayer ); for i = 1, #texts do local text = getElementData( texts[i], "text" ); local tX, tY, tZ = getElementData( texts[i], "x" ), getElementData( texts[i], "y" ), getElementData( texts[i], "z" ); local font = getElementData( texts[i], "font" ); local scale = getElementData( texts[i], "scale" ); local color = getElementData( texts[i], "rgba" ); local maxDistance = getElementData( texts[i], "maxDistance" ); if not text or not tX or not tY or not tZ then return end if not font then font = "default" end if not scale then scale = 2 end if not color or type( color ) ~= "table" then color = { 255, 255, 255, 255 }; end if not maxDistance then maxDistance = 12 end local distance = getDistanceBetweenPoints3D( pX, pY, pZ, tX, tY, tZ ); if distance <= maxDistance then local x, y = getScreenFromWorldPosition( tX, tY, tZ ); if x and y then dxDrawText( text, x, y, _, _, tocolor( color[1], color[2], color[3], color[4] ), scale, font, "center", "center" ); end end end end end ); سوو لي مثال Link to comment
mouamle Posted March 20, 2014 Share Posted March 20, 2014 تفضل function renderIng( ) local x, y, z = getCameraMatrix( ) local dimension = getElementDimension( localPlayer ) for key, marker in ipairs ( getElementsByType( "marker", resourceRoot ) ) do if getElementDimension( marker ) == dimension then local px, py, pz = getElementPosition( marker ) local distance = getDistanceBetweenPoints3D( px, py, pz, x, y, z ) if distance <= 50 then local text = getElementData( marker, "message" ) if text and ( distance < 3 or isLineOfSightClear( x, y, z, px, py, pz + 1.7, true, true, true, true, false, false, true, localPlayer ) ) then local sx, sy = getScreenFromWorldPosition( px, py, pz + 1.7 ) if sx and sy then local w = dxGetTextWidth( tostring( text ) ) local h = ( text and 3 or 1 ) * dxGetFontHeight( ) dxDrawText( tostring( text ), sx, sy, sx, sy, tocolor( 255, 255, 255, 255 ), 4, "Tahoma", "center", "center" ) end end end end end end addEventHandler( "onClientRender", getRootElement( ),renderIng) Marker = createMarker ( x, y, z, "cylinder", s, r, g, b, a ) setElementData(Marker,"message","الكتابة") الأستبدال سطر 27 أحداثيات الماركر سطر 28 الكتابة Link to comment
iMr.G[7]A Posted March 20, 2014 Author Share Posted March 20, 2014 طيب هو يسوي لي ماركر ما ابيه يسوي ماركر ابي بس اكتب بدون ماركر Link to comment
al-Kobra Posted March 20, 2014 Share Posted March 20, 2014 اول شي نزل هالمود https://community.multitheftauto.com/in ... ls&id=7613 وهذا الكود بدل اﻻرقمنتات بس local dxDraw3DText = exports.3D_DX_Texts:dxDraw3DText addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource( ) ), function( ) dxDraw3DText( "Text" ,x, y, z , 2, "default", r, b, g ) end ) Link to comment
iMr.G[7]A Posted March 20, 2014 Author Share Posted March 20, 2014 طيب نزلته وش اسوي بالكود اللي عطيتني ايآه؟ Link to comment
iPrestege Posted March 20, 2014 Share Posted March 20, 2014 سوي مود وحطة بجانب الكلنت . وعين الارقمنتات . Link to comment
iMr.G[7]A Posted March 20, 2014 Author Share Posted March 20, 2014 برستيج لو سمحت فهمني اكثر وحطلي الكودات ابي الكلمة في > سيارات اسطورة الـ زومبي < والاحداثيات 225.39700317383, 1921.7197265625, 19.9935131073 بليز سوهـ لي Link to comment
iPrestege Posted March 20, 2014 Share Posted March 20, 2014 local dxDraw3DText = exports.3D_DX_Texts:dxDraw3DText local x,y,z = 225.39700317383, 1921.7197265625, 19.9935131073 local r,g,b = 255,0,0 addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource( ) ), function( ) dxDraw3DText( "> سيارات اسطورة الـ زومبي" ,x, y, z , 2, "default", r, b, g ) end ) حمل المود اللي عطوك فوق وشغله وخلة نفس اسمة بدون تعديل وحط الكود بمود ثاني ملف كلنت وشغله وجربة. Link to comment
iMr.G[7]A Posted March 20, 2014 Author Share Posted March 20, 2014 ما طلع اي شي حطيت في ملف client local dxDraw3DText = exports.3D_DX_Texts:dxDraw3DText addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource( ) ), function( ) dxDraw3DText( "سيارات اسطورة الـ زومبي" ,225.39700317383, 1921.7197265625, 19.9935131073 , 2, "default", 255, 255, 255 ) end ) والملف حق المود --[[ // DX 3D Texts By : 彡ṔĄ!И ( version : 1.0 ) / Script : client.lua --------------------------------------------- // Visit Us At : [url=http://www.Gta-Arabs.net]http://www.Gta-Arabs.net[/url] ^^ --]] -- making a table with allowed fonts' names local fonts = { [ "default" ] = true, [ "default-bold" ] = true,[ "clear" ] = true,[ "arial" ] = true,[ "sans" ] = true, [ "pricedown" ] = true, [ "bankgothic" ] = true,[ "diploma" ] = true,[ "beckett" ] = true }; function dxDraw3DText( text, x, y, z, scale, font, r, g, b, maxDistance ) -- checking required arguments assert( type( text ) == "string", "Bad argument @ dxDraw3DText" ); assert( type( x ) == "number", "Bad argument @ dxDraw3DText" ); assert( type( y ) == "number", "Bad argument @ dxDraw3DText" ); assert( type( z ) == "number", "Bad argument @ dxDraw3DText" ); -- checking optional arguments if not scale or type( scale ) ~= "number" or scale <= 0 then scale = 2 end if not font or type( font ) ~= "string" or not fonts[ font ] then font = "default" end if not r or type( r ) ~= "number" or r < 0 or r > 255 then r = 255 end if not g or type( g ) ~= "number" or g < 0 or g > 255 then g = 255 end if not b or type( b ) ~= "number" or b < 0 or b > 255 then b = 255 end if not maxDistance or type( maxDistance ) ~= "number" or maxDistance <= 1 then maxDistance = 12 end local textElement = createElement( "text" ); -- checking if the element was created if textElement then -- setting the element datas setElementData( textElement, "text", text ); setElementData( textElement, "x", x ); setElementData( textElement, "y", y ); setElementData( textElement, "z", z ); setElementData( textElement, "scale", scale ); setElementData( textElement, "font", font ); setElementData( textElement, "rgba", { r, g, b, 255 } ); setElementData( textElement, "maxDistance", maxDistance ); -- returning the text element return textElement end -- returning false in case of errors return false end addEventHandler( "onClientRender", root, function( ) local texts = getElementsByType( "text" ); if #texts > 0 then local pX, pY, pZ = getElementPosition( localPlayer ); for i = 1, #texts do local text = getElementData( texts[i], "text" ); local tX, tY, tZ = getElementData( texts[i], "x" ), getElementData( texts[i], "y" ), getElementData( texts[i], "z" ); local font = getElementData( texts[i], "font" ); local scale = getElementData( texts[i], "scale" ); local color = getElementData( texts[i], "rgba" ); local maxDistance = getElementData( texts[i], "maxDistance" ); if not text or not tX or not tY or not tZ then return end if not font then font = "default" end if not scale then scale = 2 end if not color or type( color ) ~= "table" then color = { 255, 255, 255, 255 }; end if not maxDistance then maxDistance = 12 end local distance = getDistanceBetweenPoints3D( pX, pY, pZ, tX, tY, tZ ); if distance <= maxDistance then local x, y = getScreenFromWorldPosition( tX, tY, tZ ); if x and y then dxDrawText( text, x, y, _, _, tocolor( color[1], color[2], color[3], color[4] ), scale, font, "center", "center" ); end end end end end ); وما ضبط والحل؟ Link to comment
al-Kobra Posted March 20, 2014 Share Posted March 20, 2014 استخدم كود برستيج ! ,, : / Link to comment
mouamle Posted March 20, 2014 Share Posted March 20, 2014 تفضل function renderIng( ) local x, y, z = getCameraMatrix( ) local dimension = getElementDimension( localPlayer ) for key, marker in ipairs ( getElementsByType( "marker", resourceRoot ) ) do if getElementDimension( marker ) == dimension then local px, py, pz = getElementPosition( marker ) local distance = getDistanceBetweenPoints3D( px, py, pz, x, y, z ) if distance <= 50 then local text = getElementData( marker, "message" ) if text and ( distance < 3 or isLineOfSightClear( x, y, z, px, py, pz + 1.7, true, true, true, true, false, false, true, localPlayer ) ) then local sx, sy = getScreenFromWorldPosition( px, py, pz + 1.7 ) if sx and sy then local w = dxGetTextWidth( tostring( text ) ) local h = ( text and 3 or 1 ) * dxGetFontHeight( ) dxDrawText( tostring( text ), sx, sy, sx, sy, tocolor( 255, 255, 255, 255 ), 4, "Tahoma", "center", "center" ) end end end end end end addEventHandler( "onClientRender", getRootElement( ),renderIng) Marker = createMarker ( 225.39700317383, 1921.7197265625, 19.9935131073, "cylinder", 1, 0, 0, 0, 0 ) setElementData(Marker,"message",سيارات اسطورة الـ زومبي") الأستبدال سطر 27 أحداثيات الماركر سطر 28 الكتابة جرب هذا عدلتة بحيث يكون الماركر مخفي وأنت بس بدل أحداثيات الماركر أوكي ملاحظة >>>الماركر مخفي <<< Link to comment
Do_De<3 Posted March 20, 2014 Share Posted March 20, 2014 createMarker(225.39700317383, 1921.7197265625, 16.640625, "cylinder", 1.5, 255, 0, 0, 255 ) local x,y,z = 225.39700317383, 1921.7197265625, 17.9935131073 local r,g,b = 255,0,0 addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource( ) ), function( ) exports[ "3D_DX_Texts" ]:dxDraw3DText( "> سيارات اسطورة الـ زومبي" ,x, y, z , 2, "default", r, b, g ) end ) جرب <3 ولاتنسى تشغل مود 3D_DX_Texts Link to comment
</Mr.Tn6eL> Posted March 20, 2014 Share Posted March 20, 2014 createMarker(225.39700317383, 1921.7197265625, 16.640625, "cylinder", 1.5, 255, 0, 0, 255 ) local x,y,z = 225.39700317383, 1921.7197265625, 17.9935131073 local r,g,b = 255,0,0 addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource( ) ), function( ) exports[ "3D_DX_Texts" ]:dxDraw3DText( "> سيارات اسطورة الـ زومبي" ,x, y, z , 2, "default", r, b, g ) end ) جرب <3 ولاتنسى تشغل مود 3D_DX_Texts getResourceRootElement( getThisResource( ) = resourceRoot اختصر اكوادك ولا كوبي بست Link to comment
Do_De<3 Posted March 20, 2014 Share Posted March 20, 2014 addEventHandler( "onClientResourceStart", resourceRoot , كنت في سيرفري المجاني ونسخته مرتين >< Link to comment
</Mr.Tn6eL> Posted March 21, 2014 Share Posted March 21, 2014 addEventHandler( "onClientResourceStart", resourceRoot ,كنت في سيرفري المجاني ونسخته مرتين >< مني فاهم 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