Jump to content

سوال بسيط


Adham

Recommended Posts

سلام عليكم ورحمه الله وبركاته

اليوم التوب بار

ابيه يجي في النص الكلام ..

الاكواد

function dxDrawNotificationBar ( )
    local doRemove = { top = { }, bottom = { } }    -- This is used so it prevents the next message from flashing
    

    -- Top Message Bar
    for i, v in pairs ( messages_top ) do
        local i = i - 1
        if ( not v.locked ) then
            v.alpha = v.alpha - 2
            if ( v.alpha <= 20 ) then
                table.insert ( doRemove.top, i+1 )
            end
            messages_top[i+1].alpha = v.alpha
        else
            if ( v.alpha < 160 ) then
                v.alpha = v.alpha + 1
                messages_top[i+1].alpha = v.alpha
            end
            if ( v.rTick <= getTickCount ( ) ) then
                v.locked = false
                messages_top[i+1].locked=false
            end
        end
        dxDrawRectangle ( (sx_/2-530/2), i*25, 530, 25, tocolor ( 0, 0, 0, v.alpha ) )
        dxDrawText ( tostring ( v.message ), 0, i*25, sx_, (i+1)*25, tocolor ( v.r, v.g, v.b, v.alpha*1.49375 ), sy*1.2, "default-bold", "center", "center")
    end 
    if ( #messages_top > maxMessages and messages_top[1].locked ) then
        messages_top[1].locked = false
    end 

    -- Bottom Message Bar
    for i, v in pairs ( messages_btm ) do
        if ( not v.locked ) then
            v.alpha = v.alpha - 3
            if ( v.alpha <= 20 ) then
                table.insert ( doRemove.bottom, i )
            end
            messages_btm[i].alpha = v.alpha
        else
            if ( v.alpha < 160 ) then
                v.alpha = v.alpha + 1
                messages_btm[i].alpha = v.alpha
            end
            if ( v.rTick <= getTickCount ( ) ) then
                v.locked = false
                messages_btm[i].locked=false
            end
        end
        dxDrawRectangle ( (sx_/2-530/2), sy_-(i*25), 530, 25, tocolor ( 0, 0, 0, v.alpha ) )
        dxDrawText ( tostring ( v.message ), 0, sy_-(i*25), sx_, sy_-((i-1)*25), tocolor ( v.r, v.g, v.b, v.alpha*1.49375 ), sy*1.2, "default-bold", "center", "center")
    end 
    if ( #messages_btm > maxMessages and messages_btm[1].locked ) then
        messages_btm[1].locked = false
    end 

    -- handle message removes
    if ( #doRemove.top > 0 )then
        for i, v in pairs ( doRemove.top ) do
            table.remove ( messages_top, v )
        end
    end
    if ( #doRemove.bottom > 0 ) then
        for i, v in pairs ( doRemove.bottom ) do
            table.remove ( messages_btm, v )
        end
    end
end
addEventHandler ( "onClientRender", root, dxDrawNotificationBar )

مثلا انا حطيت الكود ذا

exports.topbarchat:sendClientMessage ( "* [Login]x "..getPlayerName(source):gsub( "#%x%x%x%x%x%x", "" ).." has login",root,255,255,0,true )

الكلام م يجي بالنص بالظبت

 

Link to comment
Just now, Deativated said:

سلام عليكم ورحمه الله وبركاته

اليوم التوب بار

ابيه يجي في النص الكلام ..

الاكواد


function dxDrawNotificationBar ( )
    local doRemove = { top = { }, bottom = { } }    -- This is used so it prevents the next message from flashing
    

    -- Top Message Bar
    for i, v in pairs ( messages_top ) do
        local i = i - 1
        if ( not v.locked ) then
            v.alpha = v.alpha - 2
            if ( v.alpha <= 20 ) then
                table.insert ( doRemove.top, i+1 )
            end
            messages_top[i+1].alpha = v.alpha
        else
            if ( v.alpha < 160 ) then
                v.alpha = v.alpha + 1
                messages_top[i+1].alpha = v.alpha
            end
            if ( v.rTick <= getTickCount ( ) ) then
                v.locked = false
                messages_top[i+1].locked=false
            end
        end
        dxDrawRectangle ( (sx_/2-530/2), i*25, 530, 25, tocolor ( 0, 0, 0, v.alpha ) )
        dxDrawText ( tostring ( v.message ), 0, i*25, sx_, (i+1)*25, tocolor ( v.r, v.g, v.b, v.alpha*1.49375 ), sy*1.2, "default-bold", "center", "center")
    end 
    if ( #messages_top > maxMessages and messages_top[1].locked ) then
        messages_top[1].locked = false
    end 

    -- Bottom Message Bar
    for i, v in pairs ( messages_btm ) do
        if ( not v.locked ) then
            v.alpha = v.alpha - 3
            if ( v.alpha <= 20 ) then
                table.insert ( doRemove.bottom, i )
            end
            messages_btm[i].alpha = v.alpha
        else
            if ( v.alpha < 160 ) then
                v.alpha = v.alpha + 1
                messages_btm[i].alpha = v.alpha
            end
            if ( v.rTick <= getTickCount ( ) ) then
                v.locked = false
                messages_btm[i].locked=false
            end
        end
        dxDrawRectangle ( (sx_/2-530/2), sy_-(i*25), 530, 25, tocolor ( 0, 0, 0, v.alpha ) )
        dxDrawText ( tostring ( v.message ), 0, sy_-(i*25), sx_, sy_-((i-1)*25), tocolor ( v.r, v.g, v.b, v.alpha*1.49375 ), sy*1.2, "default-bold", "center", "center")
    end 
    if ( #messages_btm > maxMessages and messages_btm[1].locked ) then
        messages_btm[1].locked = false
    end 

    -- handle message removes
    if ( #doRemove.top > 0 )then
        for i, v in pairs ( doRemove.top ) do
            table.remove ( messages_top, v )
        end
    end
    if ( #doRemove.bottom > 0 ) then
        for i, v in pairs ( doRemove.bottom ) do
            table.remove ( messages_btm, v )
        end
    end
end
addEventHandler ( "onClientRender", root, dxDrawNotificationBar )

مثلا انا حطيت الكود ذا


exports.topbarchat:sendClientMessage ( "* [Login]x "..getPlayerName(source):gsub( "#%x%x%x%x%x%x", "" ).." has login",root,255,255,0,true )

الكلام م يجي بالنص بالظبت

 

كيف تبيه يجيب الكلام في النص وبعدها تقول كدة الكلام يجي بالنص ؟

Link to comment

شف الكود الاخير العطيته لك

هذا الكلام م يجي في النص بالظبت

ونا ابيه يجي بالنص بالظبت

بيكون تعديل علي توب بار

أو الكود الاخير ؟

لو مب فاهم ممكن افهمك سكايب بالصور أو بالخاص .

Edited by Deativated
Link to comment
Just now, Deativated said:

شف الكود الاخير العطيته لك

هذا الكلام م يجي في النص بالظبت

ونا ابيه يجي بالنص بالظبت

بيكون تعديل علي توب بار

أو الكود الاخير ؟

التعديل على التوب بار ما دخل الكود الاخير
تأكد من احداثيات الـ متغير اللي يكتب الرسالة انع بنص الشاشة
مب عن طريق كلمة center
لكن عن طريق احداثياته في الشاشة

Link to comment
1 minute ago, Killer Project said:

التعديل على التوب بار ما دخل الكود الاخير
تأكد من احداثيات الـ متغير اللي يكتب الرسالة انع بنص الشاشة
مب عن طريق كلمة center
لكن عن طريق احداثياته في الشاشة

طيب تعال سكايب لو معك ؟

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