outputChatBox("Error creating account, contact the server admin.",source)
Client
addEventHandler("onClientGUIClick", root,
function (button, state)
if button == "left" and state == "up" then
if (source == buttonHover) then
username = exports.dxEditBox:getText( "1" )
password = exports.dxEditBox:getText( "2" )
triggerServerEvent("register1", localPlayer, username, password)
outputChatBox("Username: ".. username .." Password: " .. password .."",255,255,255,true)
end
end
end)
Server
function registerr( username, password )
if(password ~= "" and password ~= nil and username ~= "" and username ~= nil) then
local accountAdded = addAccount(username,password)
if(accountAdded) then
outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source)
else
outputChatBox("Error creating account, contact the server admin.",source)
end
else
outputChatBox("Error creating account, correct syntax: /register ",source)
end
end
addEvent( "register1", true )
addEventHandler( "register1", root, registerr )