Jump to content

طلب فنكشن


Recommended Posts

هذا مثآل لـ نص فوق المآركر

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

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 <= 20 then 
                local text = getElementData( marker, "message" )     
                if text and ( distance < 2 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 2 or 1 ) * dxGetFontHeight( ) 
                        dxDrawRectangle( sx - w / 2 - 5, sy - h / 2 - 5, w + 10, h + 10, tocolor( 0, 0, 0, 200 ) ) 
                        dxDrawText( tostring( text ), sx, sy, sx, sy, tocolor( 255, 255, 255, 255 ), 1, "default", "center", "center" ) 
                    end 
                end 
            end 
        end 
    end 
end 
addEventHandler( "onClientRender", getRootElement( ),renderIng) 
Link to comment
  • 10 months later...
هذا مثآل لـ نص فوق المآركر

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

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 <= 20 then 
                local text = getElementData( marker, "message" )     
                if text and ( distance < 2 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 2 or 1 ) * dxGetFontHeight( ) 
                        dxDrawRectangle( sx - w / 2 - 5, sy - h / 2 - 5, w + 10, h + 10, tocolor( 0, 0, 0, 200 ) ) 
                        dxDrawText( tostring( text ), sx, sy, sx, sy, tocolor( 255, 255, 255, 255 ), 1, "default", "center", "center" ) 
                    end 
                end 
            end 
        end 
    end 
end 
addEventHandler( "onClientRender", getRootElement( ),renderIng) 

مثال مو قصه حياه :(

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