Jump to content

طلب


Recommended Posts

السلام عليكم

الصراحة ما اعرف وش اسمي الموضوع بس

function ram1() 
  
    local time = getRealTime() 
    local hours = time.hour 
    local minutes = time.minute 
    local second = time.second 
    local month = time.month + 1 
    local day = time.monthday 
  
  
    if ( month == 5 ) and ( day == 18 ) then 
        outputChatBox("Today is : " .. day ) 
        outputChatBox("المصادف : " .. "1 " .. "رمضان" ) 
        Exit1() 
    end 
     
end 
addEventHandler ( "onClientRender", root, ram1 ) 
  
function Exit1() 
    removeEventHandler("onClientRender", root, ram1)  
end 
  

سويت ذا الكود وشغال تمام

بس ابي استخدم

elseif معاه

بس ما اعرف كيف اظبطها

لأن ب ال

if الأولى

راح يسوي

removeEventHandler

فكيف اخلية يرجع يتحقق مثلا من يوم 2 رمضان ؟

Link to comment
function ram1() 
  
    local time = getRealTime() 
    local hours = time.hour 
    local minutes = time.minute 
    local second = time.second 
    local month = time.month + 1 
    local day = time.monthday 
  
  
    if ( month == 5 ) and ( day == 18 ) then 
        outputChatBox("Today is : " .. day ) 
        outputChatBox("المصادف : " .. "1 " .. "رمضان" ) 
        Exit1() 
    elseif ( ) then 
    -- 
    end 
    
end 
addEventHandler ( "onClientRender", root, ram1 ) 
  
function Exit1() 
    removeEventHandler("onClientRender", root, ram1) 
end 

Link to comment
function ram1() 
  
    local time = getRealTime() 
    local hours = time.hour 
    local minutes = time.minute 
    local second = time.second 
    local month = time.month + 1 
    local day = time.monthday 
  
  
    if ( month == 5 ) and ( day == 18 ) then 
        outputChatBox("Today is : " .. day ) 
        outputChatBox("المصادف : " .. "1 " .. "رمضان" ) 
        Exit1() 
    elseif ( ) then 
    -- 
    end 
    
end 
addEventHandler ( "onClientRender", root, ram1 ) 
  
function Exit1() 
    removeEventHandler("onClientRender", root, ram1) 
end 

كيف راح يشتغل كذا

هوه لما حقق الشرط الأول راح يسوي

removeEventHandler(....) 

كيف راح يرجع يتحقق مرة ثانية ؟

Link to comment
الى اذا تحقق الشرط الاول و اذا ما تحقق بكمل على الشرط الثاني و هيك removeEventHandler هو ما راح يساوي

انت فاهم فكرة الكو ؟

يجي يوم 1 رمضان يطلع بالشات

يصادف اليوم 1 رمضان

يجي يوم 2 رمضان يطلع في الشات

يصادف اليوم 2 رمضان

وهذكا

فهوه اكيد راح يحقق الشرط الأول

Link to comment

  
function ram1() 
  
    local time = getRealTime() 
    local hours = time.hour 
    local minutes = time.minute 
    local second = time.second 
    local month = time.month + 1 
    local day = time.monthday 
  
  
    if ( month == 5 ) and ( day == 18 ) then 
        outputChatBox("Today is : " .. day ) 
        outputChatBox("المصادف : " .. "1 " .. "رمضان" ) 
        Exit1() 
    elseif ( month == 5 ) and ( day == 19 ) then 
        outputChatBox("Today is : " .. day ) 
        outputChatBox("المصادف : " .. "2 " .. "رمضان" ) 
        Exit1() 
    elseif ( month == 5 ) and ( day == 20 ) then 
        outputChatBox("Today is : " .. day ) 
        outputChatBox("المصادف : " .. "3 " .. "رمضان" ) 
        Exit1() 
    end 
    
end 
addEventHandler ( "onClientRender", root, ram1 ) 
  
function Exit1() 
    removeEventHandler("onClientRender", root, ram1) 
end 

onClientRender بس ليش انتا مستخدم

Link to comment
  
function ram1() 
  
    local time = getRealTime() 
    local hours = time.hour 
    local minutes = time.minute 
    local second = time.second 
    local month = time.month + 1 
    local day = time.monthday 
  
  
    if ( month == 5 ) and ( day == 18 ) then 
        outputChatBox("Today is : " .. day ) 
        outputChatBox("المصادف : " .. "1 " .. "رمضان" ) 
        Exit1() 
    elseif ( month == 5 ) and ( day == 19 ) then 
        outputChatBox("Today is : " .. day ) 
        outputChatBox("المصادف : " .. "2 " .. "رمضان" ) 
        Exit1() 
    elseif ( month == 5 ) and ( day == 20 ) then 
        outputChatBox("Today is : " .. day ) 
        outputChatBox("المصادف : " .. "3 " .. "رمضان" ) 
        Exit1() 
    end 
    
end 
addEventHandler ( "onClientRender", root, ram1 ) 
  
function Exit1() 
    removeEventHandler("onClientRender", root, ram1) 
end 

onClientRender بس ليش انتا مستخدم

في طريقة غيرها تخلي اللعبة تتحقق من الوقت ؟

Link to comment

تقدر تعمل تايمر كل 24 ساعه

تزيد قيمه

يعني

s = 1

هذه اول يوم رمضان الحين يجي التايمر يجي يزيد

s = s +1

و تعمل تحقق بتايمر كل 12 ساعه يشوف كم وصل قيمه s

لو وصلت 2 يسير يصادف اليوم الثاني من رمضان

Link to comment
تقدر تعمل تايمر كل 24 ساعه

تزيد قيمه

يعني

s = 1

هذه اول يوم رمضان الحين يجي التايمر يجي يزيد

s = s +1

و تعمل تحقق بتايمر كل 12 ساعه يشوف كم وصل قيمه s

لو وصلت 2 يسير يصادف اليوم الثاني من رمضان

مشكور :D

راح اجرب :)

Link to comment
تقدر تعمل تايمر كل 24 ساعه

تزيد قيمه

يعني

s = 1

هذه اول يوم رمضان الحين يجي التايمر يجي يزيد

s = s +1

و تعمل تحقق بتايمر كل 12 ساعه يشوف كم وصل قيمه s

لو وصلت 2 يسير يصادف اليوم الثاني من رمضان

function ToggleTimer() 
    DayTimer = setTimer (  
                function() 
    time = getRealTime() 
    hours = time.hour - 12 
    hours12 = time.hour 
    minutes = time.minute 
    second = time.second 
    month = time.month  
    day = time.monthday              
                     
        if ( month == 5 ) and ( day == 18 ) then 
            if ( hours12 == 7 ) or ( hours24 = 7 ) then  
                    if ( minutes == 45 ) then 
                        outputChatBox("حان الأن وقت أذان المغرب") 
                        guiSetText(GUIEditor.label[1], "1 رمضان") 
                    end 
            end 
             
        elseif ( month == 5) and ( day == 19 ) then 
            if ( hours12 == 7 ) or ( hours24 == 7 ) then 
                if ( minutes == 45 ) then 
                    outputChatBox("حان الأن وقت أذان المغرب") 
                    guiSetText(GUIEditor.label[1], "2 رمضان") 
                end 
            end 
        end 
                     
                     
                     
        end, 1000, 0 ) 
end 

يعني زي كذا ؟

بس وقت التايمر مسوية ثانية وحدة على شان أختبر اذا المود شغال :)

Link to comment
تقدر تعمل تايمر كل 24 ساعه

تزيد قيمه

يعني

s = 1

هذه اول يوم رمضان الحين يجي التايمر يجي يزيد

s = s +1

و تعمل تحقق بتايمر كل 12 ساعه يشوف كم وصل قيمه s

لو وصلت 2 يسير يصادف اليوم الثاني من رمضان

function ToggleTimer() 
    DayTimer = setTimer (  
                function() 
    time = getRealTime() 
    hours = time.hour - 12 
    hours12 = time.hour 
    minutes = time.minute 
    second = time.second 
    month = time.month  
    day = time.monthday              
                     
        if ( month == 5 ) and ( day == 18 ) then 
            if ( hours12 == 7 ) or ( hours24 = 7 ) then  
                    if ( minutes == 45 ) then 
                        outputChatBox("حان الأن وقت أذان المغرب") 
                        guiSetText(GUIEditor.label[1], "1 رمضان") 
                    end 
            end 
             
        elseif ( month == 5) and ( day == 19 ) then 
            if ( hours12 == 7 ) or ( hours24 == 7 ) then 
                if ( minutes == 45 ) then 
                    outputChatBox("حان الأن وقت أذان المغرب") 
                    guiSetText(GUIEditor.label[1], "2 رمضان") 
                end 
            end 
        end 
                     
                     
                     
        end, 1000, 0 ) 
end 

يعني زي كذا ؟

بس وقت التايمر مسوية ثانية وحدة على شان أختبر اذا المود شغال

افضل شئ تخليها وقت الاذان

+

guiSetText(GUIEditor.label[1], "2 رمضان") 

ليه انت حاطتها ومافى ليبل ؟

Link to comment
تقدر تعمل تايمر كل 24 ساعه

تزيد قيمه

يعني

s = 1

هذه اول يوم رمضان الحين يجي التايمر يجي يزيد

s = s +1

و تعمل تحقق بتايمر كل 12 ساعه يشوف كم وصل قيمه s

لو وصلت 2 يسير يصادف اليوم الثاني من رمضان

function ToggleTimer() 
    DayTimer = setTimer (  
                function() 
    time = getRealTime() 
    hours = time.hour - 12 
    hours12 = time.hour 
    minutes = time.minute 
    second = time.second 
    month = time.month  
    day = time.monthday              
                     
        if ( month == 5 ) and ( day == 18 ) then 
            if ( hours12 == 7 ) or ( hours24 = 7 ) then  
                    if ( minutes == 45 ) then 
                        outputChatBox("حان الأن وقت أذان المغرب") 
                        guiSetText(GUIEditor.label[1], "1 رمضان") 
                    end 
            end 
             
        elseif ( month == 5) and ( day == 19 ) then 
            if ( hours12 == 7 ) or ( hours24 == 7 ) then 
                if ( minutes == 45 ) then 
                    outputChatBox("حان الأن وقت أذان المغرب") 
                    guiSetText(GUIEditor.label[1], "2 رمضان") 
                end 
            end 
        end 
                     
                     
                     
        end, 1000, 0 ) 
end 

يعني زي كذا ؟

بس وقت التايمر مسوية ثانية وحدة على شان أختبر اذا المود شغال

افضل شئ تخليها وقت الاذان

+

guiSetText(GUIEditor.label[1], "2 رمضان") 

ليه انت حاطتها ومافى ليبل ؟

موجودة الليبل بس ما حطيت الكود الكامل لأن احتاج بس ذا الجزء :)

Link to comment
تقدر تعمل تايمر كل 24 ساعه

تزيد قيمه

يعني

s = 1

هذه اول يوم رمضان الحين يجي التايمر يجي يزيد

s = s +1

و تعمل تحقق بتايمر كل 12 ساعه يشوف كم وصل قيمه s

لو وصلت 2 يسير يصادف اليوم الثاني من رمضان

function ToggleTimer() 
    DayTimer = setTimer (  
                function() 
    time = getRealTime() 
    hours = time.hour - 12 
    hours12 = time.hour 
    minutes = time.minute 
    second = time.second 
    month = time.month  
    day = time.monthday              
                     
        if ( month == 5 ) and ( day == 18 ) then 
            if ( hours12 == 7 ) or ( hours24 = 7 ) then  
                    if ( minutes == 45 ) then 
                        outputChatBox("حان الأن وقت أذان المغرب") 
                        guiSetText(GUIEditor.label[1], "1 رمضان") 
                    end 
            end 
             
        elseif ( month == 5) and ( day == 19 ) then 
            if ( hours12 == 7 ) or ( hours24 == 7 ) then 
                if ( minutes == 45 ) then 
                    outputChatBox("حان الأن وقت أذان المغرب") 
                    guiSetText(GUIEditor.label[1], "2 رمضان") 
                end 
            end 
        end 
                     
                     
                     
        end, 1000, 0 ) 
end 

يعني زي كذا ؟

بس وقت التايمر مسوية ثانية وحدة على شان أختبر اذا المود شغال

افضل شئ تخليها وقت الاذان

+

guiSetText(GUIEditor.label[1], "2 رمضان") 

ليه انت حاطتها ومافى ليبل ؟

ذا الكود كامل للي يبة واي يبي يسوي نفس الفكرة الي ببالي

تعبت بية قعدت انسخ والصق واغير ارقام :/

gx, gy = guiGetScreenSize() 
GUIEditor = {
    label = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
    function()
        GUIEditor.label[1] = guiCreateLabel(gx - 50, 0, 144, 50, "رمضان", false)
        guiSetFont(GUIEditor.label[1], "default-bold-small")
        guiLabelSetColor(GUIEditor.label[1], 255, 0, 0)
        guiLabelSetHorizontalAlign(GUIEditor.label[1], "left", true)    
    end
)
 
 
function ToggleTimer()
    DayTimer = setTimer (
        function()
    time = getRealTime()
    hours = time.hour - 12
    hours12 = time.hour
    minutes = time.minute
    second = time.second
    month = time.month
    day = time.monthday            
                   
    if ( month == 5 ) and ( day == 18 ) then            
                    guiSetText(GUIEditor.label[1], "")    -- 1 Day
            if ( hours12 == 7 ) or ( hours24 == 7 ) then
                    if ( minutes == 45 ) then
                        outputChatBox("")
                    end
            end
           
        elseif ( month == 5) and ( day == 19 ) then
                        guiSetText(GUIEditor.label[1], "") -- 2 Day
            if ( hours12 == 7 ) or ( hours24 == 7 ) then
                if ( minutes == 45 ) then
                    outputChatBox("")
                end
            end
 
        elseif( month == 5 ) and ( day == 20 ) then
                        guiSetText( GUIEditor.label[1], "" ) -- 3 Day
            if ( hours12 == 7 ) or ( hours24 == 7 ) then
                if ( minutes == 45 ) then
                    outputChatBox("")
                end
            end
 
        elseif( month == 5 ) and ( day == 21 ) then
                        guiSetText( GUIEditor.label[1], "" ) -- 4 Day
            if ( hours12 == 7 ) or ( hours24 == 7 ) then
                if ( minutes == 46 ) then
                    outputChatBox("")
                end
            end
 
        elseif( month == 5 ) and ( day == 22 ) then
                        guiSetText( GUIEditor.label[1], "" ) -- 5 Day
            if ( hours12 == 7 ) or ( hours24 == 7 ) then
                if ( minutes == 46 ) then
                    outputChatBox("")
                end
            end
 
        elseif( month == 5 ) and ( day == 23 ) then
                        guiSetText( GUIEditor.label[1], "" ) -- 6
            if ( hours12 == 7 ) or ( hours24 == 7 ) then
                if ( minutes == 46 ) then
                    outputChatBox("")
                end
            end
 
        elseif( month == 5 ) and ( day == 24 ) then
                        guiSetText( GUIEditor.label[1], "" ) -- 7
            if ( hours12 == 7 ) or ( hours24 == 7 ) then
                if ( minutes == 46 ) then
                    outputChatBox("")
                end
            end
 
        elseif( month == 5 ) and ( day == 25 ) then
                        guiSetText( GUIEditor.label[1], "" ) -- 8
            if ( hours12 == 7 ) or ( hours24 == 7 ) then
                if ( minutes == 46 ) then
                    outputChatBox("")
                end
            end
 
        elseif( month == 5 ) and ( day == 26 ) then
                        guiSetText( GUIEditor.label[1], "" ) -- 9
            if ( hours12 == 7 ) or ( hours24 == 7 ) then
                if ( minutes == 46 ) then
                    outputChatBox("")
                end
            end
 
 
        elseif( month == 5 ) and ( day == 27 ) then
                        guiSetText( GUIEditor.label[1], "" ) -- 10
            if ( hours12 == 7 ) or ( hours24 == 7 ) then
                if ( minutes == 46 ) then
                    outputChatBox("")
                end
            end 
           
 
        elseif( month == 5 ) and ( day == 28 ) then
                        guiSetText( GUIEditor.label[1], "" ) -- 11
            if ( hours12 == 7 ) or ( hours24 == 7 ) then
                if ( minutes == 47 ) then
                    outputChatBox("")
                end
            end
       
                   
        elseif( month == 5 ) and ( day == 29 ) then
                        guiSetText( GUIEditor.label[1], "" ) -- 12
            if ( hours12 == 7 ) or ( hours24 == 7 ) then
                if ( minutes == 47 ) then
                    outputChatBox("")
                end
            end
       
        elseif( month == 5 ) and ( day == 30 ) then
                        guiSetText( GUIEditor.label[1], "" ) -- 13
            if ( hours12 == 7 ) or ( hours24 == 7 ) then
                if ( minutes == 47 ) then
                    outputChatBox("")
                end
            end
       
 
        elseif( month == 6 ) and ( day == 1 ) then
                        guiSetText( GUIEditor.label[1], " " ) -- 14
            if ( hours12 == 7 ) or ( hours24 == 7 ) then
                if ( minutes == 47 ) then
                    outputChatBox("")
                end
            end
       
 
        elseif( month == 6 ) and ( day == 2 ) then
                        guiSetText( GUIEditor.label[1], "" ) -- 15
            if ( hours12 == 7 ) or ( hours24 == 7 ) then
                if ( minutes == 47 ) then
                    outputChatBox("")
                end
            end
       
 
 
        elseif( month == 6 ) and ( day == 3 ) then
                        guiSetText( GUIEditor.label[1], "" ) -- 16
            if ( hours12 == 7 ) or ( hours24 == 7 ) then
                if ( minutes == 47 ) then
                    outputChatBox("")
                end
            end
       
        elseif( month == 6 ) and ( day == 4 ) then
                        guiSetText( GUIEditor.label[1], "" ) -- 17
            if ( hours12 == 7 ) or ( hours24 == 7 ) then
                if ( minutes == 47 ) then
                    outputChatBox("")
                end
            end
 
        elseif( month == 6 ) and ( day == 5 ) then
                        guiSetText( GUIEditor.label[1], "" ) -- 18
            if ( hours12 == 7 ) or ( hours24 == 7 ) then
                if ( minutes == 46 ) then
                    outputChatBox("")
                end
            end
 
        elseif( month == 6 ) and ( day == 6 ) then
                        guiSetText( GUIEditor.label[1], "" ) -- 19
            if ( hours12 == 7 ) or ( hours24 == 7 ) then
                if ( minutes == 46 ) then
                    outputChatBox("")
                end
            end
 
 
        elseif( month == 6 ) and ( day == 7 ) then
                        guiSetText( GUIEditor.label[1], "" ) -- 20
            if ( hours12 == 7 ) or ( hours24 == 7 ) then
                if ( minutes == 46 ) then
                    outputChatBox("")
                end
            end
 
        elseif( month == 6 ) and ( day == 8 ) then
                        guiSetText( GUIEditor.label[1], "" ) -- 21
            if ( hours12 == 7 ) or ( hours24 == 7 ) then
                if ( minutes == 46 ) then
                    outputChatBox("")
                end
            end
 
 
        elseif( month == 6 ) and ( day == 9 ) then
                        guiSetText( GUIEditor.label[1], "" ) -- 22
            if ( hours12 == 7 ) or ( hours24 == 7 ) then
                if ( minutes == 46 ) then
                    outputChatBox("")
                end
            end
 
        elseif( month == 6 ) and ( day == 10 ) then
                        guiSetText( GUIEditor.label[1], "" ) -- 23
            if ( hours12 == 7 ) or ( hours24 == 7 ) then
                if ( minutes == 46 ) then
                    outputChatBox("")
                end
            end
 
        elseif( month == 6 ) and ( day == 11 ) then
                        guiSetText( GUIEditor.label[1], "" ) -- 24
            if ( hours12 == 7 ) or ( hours24 == 7 ) then
                if ( minutes == 46 ) then
                    outputChatBox("")
                end
            end
 
        elseif( month == 6 ) and ( day == 12 ) then
                        guiSetText( GUIEditor.label[1], "" ) -- 25
            if ( hours12 == 7 ) or ( hours24 == 7 ) then
                if ( minutes == 45 ) then
                    outputChatBox("")
                end
            end
 
        elseif( month == 6 ) and ( day == 13 ) then
                        guiSetText( GUIEditor.label[1], "" ) -- 26
            if ( hours12 == 7 ) or ( hours24 == 7 ) then
                if ( minutes == 45 ) then
                    outputChatBox("")
                end
            end
 
        elseif( month == 6 ) and ( day == 14 ) then
                        guiSetText( GUIEditor.label[1], "" ) -- 27
            if ( hours12 == 7 ) or ( hours24 == 7 ) then
                if ( minutes == 44 ) then
                    outputChatBox("")
                end
            end
 
        elseif( month == 6 ) and ( day == 15 ) then
                       
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...