Jump to content

triggering won't work.


Karuzo

Recommended Posts

Hey Guys,

as the title says i have a problem with triggering from client-side to server-side.

Client:

            username = SpielerName 
            password = guiGetText(Register.label[1]) 
            passwordConfirm = guiGetText(Register.label[2]) 
        triggerServerEvent("onRequestRegister",getLocalPlayer(),username,password,passwordConfirm) 

Server :

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 ("#00FF00Herzlich Willkommen!! [username: #FFFFFF" .. username .. " #00FF00| Passwort: #FFFFFF" .. password .. "#00FF00 ]",source,255,255,255,true ) 
                        else 
                            outputChatBox("Bitte versuche es wieder mit einem anderen Usernamen und Passwort!!", thePlayer, 255, 0, 0) 
                        end 
                    else 
                        outputChatBox("Dieser Name existiert bereits!!", thePlayer, 255, 0, 0) 
                    end 
                else 
                    outputChatBox("Die Passwörter stimmen nicht überein!!", thePlayer, 255, 0, 0) 
                end 
            else 
                outputChatBox("Du musst dein Passwort nochmal eingeben!", thePlayer, 255, 0, 0) 
            end 
        else 
            outputChatBox("Du musst dein Passwort eingeben!", thePlayer, 255, 0, 0) 
        end 
    else 
        outputChatBox("Du musst deinen Namen eingeben!", thePlayer, 255, 0, 0) 
    end 
end 
addEvent("onRequestRegister",true) 
addEventHandler("onRequestRegister",getRootElement(),registerPlayer) 

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