Jump to content

dx طلب فنكش لـ الخط الـ


Recommended Posts

ابي فنكش الخط يجي في مكان معين ويكون dx

  
  
local screenW, screenH = guiGetScreenSize() 
  
addEventHandler("onClientRender", root, 
    function() 
        dxDrawText("وظيفة الادمنيه / Job Staff", 202 - 1, 347 - 1, 823 - 1, 421 - 1, tocolor(0, 0, 0, 255), 5.00, "arial", "center", "top", false, false, false, false, false) 
        dxDrawText("وظيفة الادمنيه / Job Staff", 202 + 1, 347 - 1, 823 + 1, 421 - 1, tocolor(0, 0, 0, 255), 5.00, "arial", "center", "top", false, false, false, false, false) 
        dxDrawText("وظيفة الادمنيه / Job Staff", 202 - 1, 347 + 1, 823 - 1, 421 + 1, tocolor(0, 0, 0, 255), 5.00, "arial", "center", "top", false, false, false, false, false) 
        dxDrawText("وظيفة الادمنيه / Job Staff", 202 + 1, 347 + 1, 823 + 1, 421 + 1, tocolor(0, 0, 0, 255), 5.00, "arial", "center", "top", false, false, false, false, false) 
        dxDrawText("وظيفة الادمنيه / Job Staff", (screenW - 621) / 2, (screenH - 74) / 2, ((screenW - 621) / 2) + 621, ( (screenH - 74) / 2) + 74, tocolor(255, 255, 255, 255), 5.00, "arial", "center", "top", false, false, false, false, false) 
    end 
) 
  

Link to comment

أخوي م في شي اسمه فنكش يحجيب الدي اكس في مكان معين في كذا شوف

شوف السنتاكس وطبقه

bool dxDrawText ( string text, float left, float top [, float right=left, float bottom=top, int color=white, float scale=1, 
                  mixed font="default", string alignX="left", string alignY="top", bool clip=false, bool wordBreak=false, 
                  bool postGUI=false, bool colorCoded=false, bool subPixelPositioning=false, 
                  float fRotation=0, float fRotationCenterX=0, float fRotationCenterY=0 ] ) 

انت تقدر تتحكم بالاحداثيات واذا تقصد تبي تحطها بمكان معين في الماب او فوق بيد مثلا او فوق اي شي تسوي عن طريق ذا الفنكش

getElementPosition 
getDistanceBetweenPoints2D 

واذا م عندك مانع اعرض الفكرة حقتك وأبشر اسويلك الكود

Link to comment

جرب

element = ------ هنا اسم البيد او اي المنت تبي تحط فوقه كلام 
text = "" ------ هنا النص الكلام الي تبي تحطه فوقه حطه بين القوسين 
  
-------------------------------- 
function drawPedText() 
local x, y, z = getElementPosition(element) 
    local x2, y2, z2 = getElementPosition(localPlayer) 
    if ( isLineOfSightClear(x, y, z, x2, y2, z2, true, true, false, true) ) then 
        local sx, sy = getScreenFromWorldPosition(x, y, z+1.3) 
        if ( sx ) and ( sy ) then 
            local distance = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) 
            if ( distance < 30 ) then 
                dxDrawText(text, sx+2, sy+2, sx, sy, tocolor(0,255,0), 2-(distance/20), "default-bold", "center", "center") 
                            end 
        end 
    end 
end 
addEventHandler("onClientRender", getRootElement(), drawPedText)  
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...