Это в 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)
Проблема в том, что не получается не зарегаться ни залогиниться