function registerPlayer(username,password,passwordConfirm)
if not (username == "") then
if not (password == "") then
if not (passwordConfirm == "") then
if password == passwordConfirm then
local account = getAccount (username,password)
if (account == false) then
local accountAdded = addAccount(tostring(username),tostring(password))
if (accountAdded) then
outputChatBox ("#FF0000* #00FF00You have sucessfuly registered! [Username: #FFFFFF" .. username .. " #00FF00| Password: #FFFFFF" .. password .. "#00FF00 ]",source,255,255,255,true )
else
triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","An unknown error has occured! Please choose a different username/password and try again.")
end
else
triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","An account with this username already exists!")
end
else
triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","Passwords do not match!")
end
else
triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","Please confirm your password!")
end
else
triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","Please enter a password!")
end
else
triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","Please enter a username you would like to register with!")
end
end
addEvent("onRequestRegister",true)
addEventHandler("onRequestRegister",getRootElement(),registerPlayer)
wheni press the register key the debug says that the resource can't add account as in :
local accountAdded = addAccount(tostring(username),tostring(password))