Jump to content

مشكلة في لوحة آلتسسجيل !


Recommended Posts

آلسلام عليكم ,

انا عندي لوحة تسجيل ودخول

ضبطت كل شي

بس عندي مشكله لما آشغل المود تطلع النافذه على طول ,

ولما آضغط على لوقين , مآيسجل دخولي وآلريجستر نفس آلمشكله

ومآيطلع بآلديبوق شي !

وهذا الكود

- كلنت

local screen = { guiGetScreenSize() } 
local w, h = 515, 315 
local x, y = (screen[1] - w) / 2, ( screen[2] - h ) / 2 
  
 GUIEditor = { 
    memo = {}, 
    staticimage = {} 
} 
    GUIEditor.staticimage[1] = guiCreateStaticImage(266, 196, 515, 315, "Panel.png", false) 
    guiSetVisible(GUIEditor.staticimage[1], false) 
        login = guiCreateButton(130, 276, 118, 24, "", false, GUIEditor.staticimage[1]) 
        guiSetAlpha(login, 0.00) 
        guiSetProperty(login, "NormalTextColour", "FFAAAAAA") 
        register = guiCreateButton(273, 273, 115, 27, "", false, GUIEditor.staticimage[1]) 
        guiSetAlpha(register, 0.00) 
        guiSetProperty(register, "NormalTextColour", "FFAAAAAA") 
  
        user = guiCreateEdit(230, 96, 158, 34, "", false, GUIEditor.staticimage[1]) 
        guiEditSetMaxLength(user, 10) 
        pass = guiCreateEdit(230, 172, 158, 34, "", false, GUIEditor.staticimage[1]) 
        guiEditSetMasked(pass, true)     
         
 addEventHandler ("onClientGUIClick", getRootElement(), 
function(button, state, absoluteX, absoluteY) 
    if ( source ==  login ) then 
    triggerServerEvent("onlogin",getLocalPlayer(),user,pass)  
    elseif ( source ==  register ) then 
    triggerServerEvent("onregister",getLocalPlayer(),user,pass)  
    end 
end 
) 
  
function guiAddInterpolateEffect(...) 
    return call(getResourceFromName("GIE"), "guiAddInterpolateEffect", unpack({...})) 
end 
  
bindKey("F5", "down", 
function() 
    local isVisible = guiGetVisible(GUIEditor.staticimage[1]) 
    if isVisible then 
        local cx, cy = guiGetPosition(GUIEditor.staticimage[1], false) 
        local cw, ch = guiGetSize( GUIEditor.staticimage[1], false) 
        guiAddInterpolateEffect(GUIEditor.staticimage[1], cx, cy, cw, ch, 0, 0, 0, 0, 2, "Linear", "Linear", false) 
    else 
        guiAddInterpolateEffect(GUIEditor.staticimage[1], 0, 0, 0, 0, x, y, w, h, 2, "Linear", "Linear", true) 
    end 
    showCursor(not isVisible) 
end) 
  

- سيرفر

addEvent("onlogin",true) 
addEventHandler("onlogin",getRootElement(), 
    function (user,pass) 
        local account = getAccount(user,pass) 
        if ( account ) then 
            logIn(source,account,pass) 
        else 
        outputChatBox("Worng Pass !",source,255,0,0,true) 
        end 
    end 
) 
  
addEvent("onregister",true) 
addEventHandler("onregister",getRootElement(), 
    function (user,pass) 
        local account = getAccount(user,pass) 
        if ( account ) then 
            outputChatBox("* This Account is Already Used",source,255,0,0) 
        else 
            addAccount(user,pass) 
            outputChatBox("UserName: " .. user .. " PassWord : " .. pass,source,0,150,255) 
        end 
    end 
) 

- ملآحظهه : اللوحه انا مستخدم المود حق بآين على مآعتقد آلي يخلي آلنافذه تطلع بشكل ثآني يعني من فوق وكذآ

Link to comment

ياخي انت مو حاط حدث يوم يشتغل المود !

جرب كلنت ---

  
local screen = { guiGetScreenSize() } 
local w, h = 515, 315 
local x, y = (screen[1] - w) / 2, ( screen[2] - h ) / 2 
  
 GUIEditor = { 
    memo = {}, 
    staticimage = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
function() 
  
    GUIEditor.staticimage[1] = guiCreateStaticImage(266, 196, 515, 315, "Panel.png", false) 
    guiSetVisible(GUIEditor.staticimage[1], false) 
        login = guiCreateButton(130, 276, 118, 24, "", false, GUIEditor.staticimage[1]) 
        guiSetAlpha(login, 0.00) 
        guiSetProperty(login, "NormalTextColour", "FFAAAAAA") 
        register = guiCreateButton(273, 273, 115, 27, "", false, GUIEditor.staticimage[1]) 
        guiSetAlpha(register, 0.00) 
        guiSetProperty(register, "NormalTextColour", "FFAAAAAA") 
  
        user = guiCreateEdit(230, 96, 158, 34, "", false, GUIEditor.staticimage[1]) 
        guiEditSetMaxLength(user, 10) 
        pass = guiCreateEdit(230, 172, 158, 34, "", false, GUIEditor.staticimage[1]) 
        guiEditSetMasked(pass, true)     
        
end 
) 
 addEventHandler ("onClientGUIClick", getRootElement(), 
function(button, state, absoluteX, absoluteY) 
    if ( source ==  login ) then 
    triggerServerEvent("onlogin",getLocalPlayer(),user,pass) 
    elseif ( source ==  register ) then 
    triggerServerEvent("onregister",getLocalPlayer(),user,pass) 
    end 
end 
) 
  
function guiAddInterpolateEffect(...) 
    return call(getResourceFromName("GIE"), "guiAddInterpolateEffect", unpack({...})) 
end 
  
bindKey("F5", "down", 
function() 
    local isVisible = guiGetVisible(GUIEditor.staticimage[1]) 
    if isVisible then 
        local cx, cy = guiGetPosition(GUIEditor.staticimage[1], false) 
        local cw, ch = guiGetSize( GUIEditor.staticimage[1], false) 
        guiAddInterpolateEffect(GUIEditor.staticimage[1], cx, cy, cw, ch, 0, 0, 0, 0, 2, "Linear", "Linear", false) 
    else 
        guiAddInterpolateEffect(GUIEditor.staticimage[1], 0, 0, 0, 0, x, y, w, h, 2, "Linear", "Linear", true) 
    end 
    showCursor(not isVisible) 
end) 
  

Link to comment
addEventHandler ("onClientGUIClick", getRootElement(), 
function(button, state, absoluteX, absoluteY) 
    local user, pass = guiGetText(user), guiGetText(pass) 
    if ( source ==  login ) then 
    triggerServerEvent("onlogin",getLocalPlayer(),user,pass) 
    elseif ( source ==  register ) then 
    triggerServerEvent("onregister",getLocalPlayer(),user,pass) 
    end 
end 
) 
  

الخطا انك جايب الادت مو نص الادت

Link to comment
addEventHandler ("onClientGUIClick", getRootElement(), 
function(button, state, absoluteX, absoluteY) 
    local user, pass = guiGetText(user), guiGetText(pass) 
    if ( source ==  login ) then 
    triggerServerEvent("onlogin",getLocalPlayer(),user,pass) 
    elseif ( source ==  register ) then 
    triggerServerEvent("onregister",getLocalPlayer(),user,pass) 
    end 
end 
) 
  

الخطا انك جايب الادت مو نص الادت

X

Link to comment
addEventHandler ("onClientGUIClick", getRootElement(), 
function(button, state, absoluteX, absoluteY) 
    local user, pass = guiGetText(user), guiGetText(pass) 
    if ( source ==  login ) then 
    triggerServerEvent("onlogin",getLocalPlayer(),user,pass) 
    elseif ( source ==  register ) then 
    triggerServerEvent("onregister",getLocalPlayer(),user,pass) 
    end 
end 
) 
  

الخطا انك جايب الادت مو نص الادت

وش دخل ذي

هو يقول اول مايشغل السسكربت تفتح النافذه :|

Link to comment

--Client

local screen =  guiGetScreenSize()  
local w, h = 515, 315 
local x, y =  screen - w  / 2,  screen  - h  / 2  
  
 GUIEditor = { 
    memo = {}, 
    staticimage = {} 
} 
  
addEventHandler ( 'onClientResourceStart', resourceRoot, 
function ( ) 
    GUIEditor.staticimage[1] = guiCreateStaticImage(266, 196, 515, 315, "Panel.png", false) 
       guiSetVisible(GUIEditor.staticimage[1], false) 
        login = guiCreateButton(130, 276, 118, 24, "", false, GUIEditor.staticimage[1]) 
        guiSetAlpha(login, 0.00) 
        guiSetProperty(login, "NormalTextColour", "FFAAAAAA") 
        register = guiCreateButton(273, 273, 115, 27, "", false, GUIEditor.staticimage[1]) 
        guiSetAlpha(register, 0.00) 
        guiSetProperty(register, "NormalTextColour", "FFAAAAAA") 
        user = guiCreateEdit(230, 96, 158, 34, "", false, GUIEditor.staticimage[1]) 
        guiEditSetMaxLength(user, 10) 
        pass = guiCreateEdit(230, 172, 158, 34, "", false, GUIEditor.staticimage[1]) 
        guiEditSetMasked(pass, true)  
    end    
    ) 
     
     addEventHandler ("onClientGUIClick", getRootElement(), 
     function( ) 
    if ( source ==  login ) then 
    local user = guiGetText ( user ) 
    local pass = guiGetText ( pass ) 
    triggerServerEvent("onlogin",getLocalPlayer(),user,pass) 
    elseif ( source ==  register ) then 
    local user = guiGetText ( user ) 
    local pass = guiGetText ( pass ) 
    triggerServerEvent("onregister",getLocalPlayer(),user,pass) 
    end 
end 
) 
  
function guiAddInterpolateEffect(...) 
    return call(getResourceFromName("GIE"), "guiAddInterpolateEffect", unpack({...})) 
end 
  
bindKey("F5", "down", 
function() 
    local isVisible = guiGetVisible(GUIEditor.staticimage[1]) 
    if isVisible then 
        local cx, cy = guiGetPosition(GUIEditor.staticimage[1], false) 
        local cw, ch = guiGetSize( GUIEditor.staticimage[1], false) 
        guiAddInterpolateEffect(GUIEditor.staticimage[1], cx, cy, cw, ch, 0, 0, 0, 0, 2, "Linear", "Linear", false) 
    else 
        guiAddInterpolateEffect(GUIEditor.staticimage[1], 0, 0, 0, 0, x, y, w, h, 2, "Linear", "Linear", true) 
    end 
    showCursor(not isVisible) 
end) 
  
  
addEvent ( "Hide", true ) 
addEventHandler ( "Hide", root, 
    function ( ) 
        if ( guiGetVisible ( GUIEditor.staticimage[1] ) == true ) then   
            guiSetVisible ( GUIEditor.staticimage[1], false )     
            showCursor ( false ) 
            fadeCamera ( true ) 
        end 
    end 
) 

---Server

addEvent ( "onlogin", true ) 
addEventHandler ( "onlogin", root, 
     function ( user, pass ) 
        local account = getAccount ( user, pass ) 
        if ( account ) then 
        logIn ( source, account, pass ) 
            triggerClientEvent ( source, "Hide", source ) 
        else 
        outputChatBox ( "يوجد خطأ بـ اسم المستخدم / كلمة المرور", source, 255, 0, 0, true ) 
        end 
    end 
) 
  
addEvent("onregister",true) 
addEventHandler("onregister",getRootElement(), 
    function (user,pass) 
        local account = getAccount(user,pass) 
        if ( account ) then 
            outputChatBox("* This Account is Already Used",source,255,0,0) 
        else 
            addAccount(user,pass) 
            triggerClientEvent ( source, "Hide", source ) 
            outputChatBox("UserName: " .. user .. " PassWord : " .. pass,source,0,150,255) 
        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...