Jump to content

مساعد في الوقت xX[تعديل]Xx


Recommended Posts

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

سويت زر ولما اضغط عليه يحط الوقت يلي مكتوب بي لبل المهمة هاي الاوكواد مب شغاله ابي تعديل

addEventHandler("onClientGUIClick",root, 
function() 
if source == GUIEditor.button[9] then 
if tonumber(GUIEditor.edit[1]) < 24 and tonumber(GUIEditor.edit[1]) > -1 then 
if tonumber(GUIEditor.edit[2]) < 60 and tonumber(GUIEditor.edit[2]) > -1 then 
if GUIEditor.edit[1] = '' and GUIEditor.edit[2] ~= '' then 
setTime(tonumber(GUIEditor.edit[1]),tonumber(GUIEditor.edit[2])) 
outputChatBox("تم تغير الوقت بنجاح", 0, 255, 0) 
end 
end 
end 
end 
end 
) 

Link to comment

addEventHandler("onClientGUIClick",root, 
    function() 
        if source == GUIEditor.button[9] then 
            if tonumber(guiGetText(GUIEditor.edit[1])) < 24 and tonumber(guiGetText(GUIEditor.edit[1])) > -1 then 
                if tonumber(guiGetText(GUIEditor.edit[2])) < 60 and tonumber(guiGetText(GUIEditor.edit[2])) > -1 then 
                    if GUIEditor.edit[1] ~= '' and GUIEditor.edit[2] ~= '' then 
                        setTime(tonumber(guiGetText(GUIEditor.edit[1])),tonumber(guiGetText(GUIEditor.edit[2]))) 
                        outputChatBox("تم تغير الوقت بنجاح", 0, 255, 0) 
                    end 
                end 
            end 
        end 
    end 
) 
Edited by Guest
Link to comment
  • Moderators
addEventHandler("onClientGUIClick",root, 
    function() 
        if source == GUIEditor.button[9] then 
            if tonumber(GUIEditor.edit[1]) < 24 and tonumber(GUIEditor.edit[1]) > -1 then 
                if tonumber(GUIEditor.edit[2]) < 60 and tonumber(GUIEditor.edit[2]) > -1 then 
                    if GUIEditor.edit[1] = '' and GUIEditor.edit[2] ~= '' then 
                        setTime(tonumber(guiGetText(GUIEditor.edit[1])),tonumber(guiGetText(GUIEditor.edit[2]))) 
                        outputChatBox("تم تغير الوقت بنجاح", 0, 255, 0) 
                    end 
                end 
            end 
        end 
    end 
) 

من سطر 4 الي 6 كله غلط

Link to comment
كفووو

شكرا لكم ميزو ونصور ما قصرتم والله

ممكن تقولولي وش الغلط بكودي ؟

المشكلة انك مسوي كذا

tonumber(GUIEditor.edit[1])

الحين انت م جبت الارقام الي بداخل النص

عشان كذا

تستخدم guiGetText

مثلا مثال

if tonumber(guiGetText(GUIEditor.edit[1])) >= 1 then 
    outputChatBox('الرقم هو 1 او اكبر') 
end 
  

والعفو حياك الله باي وقت ^^

Link to comment
كفووو

شكرا لكم ميزو ونصور ما قصرتم والله

ممكن تقولولي وش الغلط بكودي ؟

المشكلة انك مسوي كذا

tonumber(GUIEditor.edit[1])

الحين انت م جبت الارقام الي بداخل النص

عشان كذا

تستخدم guiGetText

مثلا مثال

if tonumber(guiGetText(GUIEditor.edit[1])) >= 1 then 
    outputChatBox('الرقم هو 1 او اكبر') 
end 
  

والعفو حياك الله باي وقت ^^

شكرا

Link to comment
addEventHandler ( "onClientGUIClick", resourceRoot, 
    function (   ) 
        if ( source == GUIEditor.button[9] ) then 
            if ( guiGetText ( GUIEditor.edit[1] ) ~= "" and guiGetText ( GUIEditor.edit[2] ) ~= "" and tonumber ( guiGetText ( GUIEditor.edit[1] ) ) and tonumber ( guiGetText ( GUIEditor.edit[2] ) ) and tonumber ( guiGetText ( GUIEditor.edit[1] ) ) < 24 and tonumber ( guiGetText ( GUIEditor.edit[1] ) ) > -1 and tonumber ( guiGetText ( GUIEditor.edit[2] ) ) < 60 and tonumber ( guiGetText ( GUIEditor.edit[2] ) ) > -1 ) then 
                setTime ( tonumber ( guiGetText ( GUIEditor.edit[1] ) ), tonumber ( guiGetText ( GUIEditor.edit[2] ) ) ) 
                outputChatBox ( "تم تغير الوقت بنجاح", 0, 255, 0, true ) 
            end 
        end 
    end 
) 

كذا الكود مرتب بشكل افضل .

Edited by Guest
Link to comment
addEventHandler("onClientGUIClick",root, 
    function (   ) 
        if ( source == GUIEditor.button[9] ) then 
            if ( GUIEditor.edit[1] ~= "" and GUIEditor.edit[2] ~= "" and tonumber ( guiGetText ( GUIEditor.edit[1] ) ) and tonumber ( guiGetText ( GUIEditor.edit[1] ) ) < 24 and tonumber ( guiGetText ( GUIEditor.edit[1] ) ) > -1 and tonumber ( guiGetText ( GUIEditor.edit[2] ) ) < 60 and tonumber ( guiGetText ( GUIEditor.edit[2] ) ) > -1 ) then 
                setTime ( tonumber ( guiGetText ( GUIEditor.edit[1] ) ), tonumber ( guiGetText ( GUIEditor.edit[2] ) ) ) 
                outputChatBox ( "تم تغير الوقت بنجاح", 0, 255, 0, true ) 
            end 
        end 
    end 
) 

كذا الكود مرتب بشكل افضل .

addEventHandler("onClientGUIClick",root, 
    function() 
        if source == GUIEditor.button[9] then 
            if tonumber(guiGetText(GUIEditor.edit[1])) < 24 and tonumber(guiGetText(GUIEditor.edit[1])) > -1 then 
                if tonumber(guiGetText(GUIEditor.edit[2])) < 60 and tonumber(guiGetText(GUIEditor.edit[2])) > -1 then 
                    if GUIEditor.edit[1] ~= '' and GUIEditor.edit[2] ~= '' then 
                        setTime(tonumber(guiGetText(GUIEditor.edit[1])),tonumber(guiGetText(GUIEditor.edit[2]))) 
                        outputChatBox("تم تغير الوقت بنجاح", 0, 255, 0) 
                    end 
                end 
            end 
        end 
    end 
) 

ما هو الفرق ؟

نفس الكود الحين هذا تزويد مشاركات صح ؟ ...

Link to comment
  • Moderators
addEventHandler ( "onClientGUIClick", resourceRoot, 
    function (   ) 
        if ( source == GUIEditor.button[9] ) then 
            if ( GUIEditor.edit[1] ~= "" and GUIEditor.edit[2] ~= "" and tonumber ( guiGetText ( GUIEditor.edit[1] ) ) and tonumber ( guiGetText ( GUIEditor.edit[2] ) ) and tonumber ( guiGetText ( GUIEditor.edit[1] ) ) < 24 and tonumber ( guiGetText ( GUIEditor.edit[1] ) ) > -1 and tonumber ( guiGetText ( GUIEditor.edit[2] ) ) < 60 and tonumber ( guiGetText ( GUIEditor.edit[2] ) ) > -1 ) then 
                setTime ( tonumber ( guiGetText ( GUIEditor.edit[1] ) ), tonumber ( guiGetText ( GUIEditor.edit[2] ) ) ) 
                outputChatBox ( "تم تغير الوقت بنجاح", 0, 255, 0, true ) 
            end 
        end 
    end 
) 

كذا الكود مرتب بشكل افضل .

تصحيح لكودك

  
addEventHandler ( "onClientGUIClick", resourceRoot, 
    function (   ) 
        if ( source == GUIEditor.button[9] ) then 
            if ( guiGetText (GUIEditor.edit[1]) ~= "" and guiGetText (GUIEditor.edit[2]) ~= "" and tonumber ( guiGetText ( GUIEditor.edit[1] ) ) and tonumber ( guiGetText ( GUIEditor.edit[2] ) ) and tonumber ( guiGetText ( GUIEditor.edit[1] ) ) < 24 and tonumber ( guiGetText ( GUIEditor.edit[1] ) ) > -1 and tonumber ( guiGetText ( GUIEditor.edit[2] ) ) < 60 and tonumber ( guiGetText ( GUIEditor.edit[2] ) ) > -1 ) then 
                setTime ( tonumber ( guiGetText ( GUIEditor.edit[1] ) ), tonumber ( guiGetText ( GUIEditor.edit[2] ) ) ) 
                outputChatBox ( "تم تغير الوقت بنجاح", 0, 255, 0, true ) 
            end 
        end 
    end 
) 
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...