Jump to content

طلب كود اغلاق تلقائي


Recommended Posts

هلا شباب

عندي مود تسجيل دخول

لاكن عندي مشكله

كل مااسجل دخولي لازم اضغط اف7 عشان يغلق

اناا ابيه لما اضغط تسجيل دخول يغلق اللوحة

واابيه لما اضغط تسجيل يغلق اللوحة

الاكوواد

الكلنت

--]]------------------by FOX ------------------------------- 
--]]------------------------------------------------- 
  
  
GUIEditor = { 
    staticimage = {}, 
    edit = {}, 
    button = {}, 
    window = {}, 
    label = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(0, 0, 1024, 768, "x~>|login penal by FOX|<~x", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetAlpha(GUIEditor.window[1], 1.00) 
        guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF48FE00") 
  
        GUIEditor.edit[1] = guiCreateEdit(655, 521, 354, 67, "", false, GUIEditor.window[1]) 
        GUIEditor.edit[2] = guiCreateEdit(655, 622, 349, 66, "fiseze9897", false, GUIEditor.window[1]) 
        GUIEditor.button[1] = guiCreateButton(61, 531, 226, 57, "Login", false, GUIEditor.window[1]) 
        local font_0 = guiCreateFont(":FOX-skin/customfont.ttf") 
        guiSetFont(GUIEditor.button[1], font_0) 
        guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF000BFF") 
        GUIEditor.button[2] = guiCreateButton(61, 618, 225, 61, "Register", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.button[2], font_0) 
        guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FF23FF00") 
        GUIEditor.staticimage[1] = guiCreateStaticImage(9, 20, 1005, 454, ":login/images/Logo.png", false, GUIEditor.window[1]) 
        GUIEditor.label[1] = guiCreateLabel(499, 647, 207, 57, "password  كلمة السر   ", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.label[1], "default-bold-small") 
        guiLabelSetColor(GUIEditor.label[1], 0, 11, 255) 
        GUIEditor.label[2] = guiCreateLabel(497, 531, 207, 57, "username    الحساب  ", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.label[2], "default-bold-small") 
        guiLabelSetColor(GUIEditor.label[2], 0, 11, 255)     
    end 
) 
  
addEventHandler ("onClientGUIClick", getRootElement(), 
function() 
    local userName = guiGetText(GUIEditor.edit[1]) 
    local passWord = guiGetText(GUIEditor.edit[2]) 
    if userName ~= "" and passWord ~= "" then 
        if source == GUIEditor.button[1] then 
            triggerServerEvent("Login-Register", localPlayer, "Login", userName, passWord) 
        elseif source == GUIEditor.button[2] then 
            triggerServerEvent("Login-Register", localPlayer, "Register", userName, passWord) 
        end 
    end 
end) 
  
function show() 
    guiSetVisible(GUIEditor.window[1], not guiGetVisible(GUIEditor.window[1])) 
    showCursor(guiGetVisible(GUIEditor.window[1])) 
end 
bindKey("F7", "down", show) 

السيرفر

addEvent("Login-Register", true) 
addEventHandler("Login-Register", root, 
function(action, userName, passWord) 
    if (action == "Login") then 
        local account = getAccount(userName, passWord) 
        if account then 
            logIn(source, account, passWord) 
        else 
            outputChatBox ("Wrong username or password! | خطاء في الاسم او الباسورد", source, 255, 255, 0) 
        end 
    elseif (action == "Register") then 
        if not getAccount(userName) then 
            local accountAdded = addAccount(userName, passWord) 
            if accountAdded then 
                outputChatBox("Thank you|شكرا لك "..getPlayerName(source)..", you're now registred, you can login with /login | الان لقد اتممت التسجيل فضضلا اذهب لتسجيل الدخول", source, 0, 255, 0) 
            else 
                outputChatBox("Error creating account, contact the server admin | خطاء في صنع الحساب اذا لما تستطع صنع الحساب فل تتواصل مع الادمين ", source, 255, 0, 0) 
            end 
        else 
            outputChatBox("اسم الحساب هذا مسجل من قبل", source, 255, 0, 0) 
        end 
    end 
end) 

Link to comment

ضيف هذا الكود في ملف سيرفر تحت سطر 7 او تحت كود

login

ضيف هذا

triggerClientEvent ( client,'showGui',client ) 

وضيف هذا بـ الكلنت في اي مكااان

addEvent("showGui", true) 
addEventHandler("showGui", root,function () 
    if guiGetVisible ( GUIEditor.window[1] ) then   
        guiSetVisible ( GUIEditor.window[1],false ) 
        showCursor ( false) 
    end 
end) 

بس لاتنسي لازم تحاااول عشان تتعلم .. :wink:

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