Jump to content

Системы регистрации с GUI. В чем проблема?


Recommended Posts

Это в server

function registerPlayer ( source, commandName, password ) 
    if ( password ~= "" and password ~= nil ) then 
        local accountAdded = addAccount( getPlayerName(source), password ) 
        if ( accountAdded ) then 
            outputChatBox ( "Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login", source ) 
            triggerClientEvent (player, "CloseRegisterPanel") 
        else 
            outputChatBox ( "Error creating account, contact the server admin", source ) 
            end 
    end 
end 
addCommandHandler ( "register", registerPlayer ) 

А это в client

showCursor(true) 
function onLoginKlick() 
     guiSetVisible ( GUIEditor.window[1], false ) 
     showCursor(false) 
end 
addEventHandler("onClientGUIClick", GUIEditor.button[2], onLoginKlick, false) 
function closeLoginPanel() 
     guiSetVisible ( GUIEditor.tabpanel[1] , false ) 
     showCursor(false) 
end 
function registerPlayer ( source, commandName, password ) 
   local username = guiGetText( GUIEditor.edit[1] ) 
   local password = guiGetText( GUIEditor.edit[2] ) 
   triggerServerEvent("register", getLocalPlayer(), getLocalPlayer(), username, password ) 
   if ( password ~= "" and password ~= nil ) then 
    end 
end 
addEventHandler("onClientGUIClick", GUIEditor.button[1], registerPlayer) 

Проблема в том, что не получается не зарегаться ни залогиниться

Edited by Guest
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...