Jump to content

[ Help ] Problem in Coding Register Panel


HustraDev

Recommended Posts

Hi Guys, :D

I need Some Help in This register script i made register panel [ clientside and serverside ] and i Added The Resource To admin ACLgroup but when I Tested not Working

Code :

Server Side : -

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 
                        
                        outputChatBox ("[msg ]",source,255,255,255,true ) 
                         
                 
                        end 
                    end   
                end 
            end  
        end 
    end 
end 
addEvent("onRequestRegister",true) 
addEventHandler("onRequestRegister",getRootElement(),registerPlayer) 
  

Client Side :-

  
function onClickBtnRegister(button,state) -- Register and Cofirm 
    if(button == "left" and state == "up") then 
            username = guiGetText(editrename) 
            password = guiGetText(edtrepass) 
            passwordConfirm = guiGetText(edtreconfirm) 
            triggerServerEvent("onRequestRegister",getLocalPlayer(), username, password, passwordConfirm) 
    end 
end 
  

Thanks ,

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...