Jump to content

مساعده ب اصلاح كود


Recommended Posts

اسلام عليكم ابي مساعده انا معي لوحة تسجيل و حطيت اذا الاعب سجل اول مره يحطه ب المطار بس ما زبط

ذا الكود

addEvent("Login-Register", true) 
addEventHandler("Login-Register", root, 
function(action, userName, passWord) 
    if (action == "Login") then 
        local account = getAccount(userName, passWord) 
        if account then 
            logIn(source, account, passWord) 
            triggerClientEvent(source, "onLoginSuccess", source) 
        else 
            exports["guimessages"]:outputServer(source,"Wrong username or password!",0, 255, 50) 
        end 
    elseif (action == "Register") then 
        local serial = getPlayerSerial(source) 
        local TotalAcc = TotalAccounts(serial) or 0 
        if TotalAcc < 3 then 
            if not getAccount(userName) then 
                local accountAdded = addAccount(userName, passWord) 
                if accountAdded then 
    spawnPlayer (source,1682.52588,-2327.87305,13.54688, 0,0, 0, 0) 
    setPlayerMoney (source, 100000) 
                    exports["guimessages"]:outputServer(source,"You have successfully registered!, you can now login with your username and password.",0, 255, 50) 
                    setAccountData(accountAdded, "reg-Serial", serial) 
                else 
                    exports["guimessages"]:outputServer(source,"Error creating account, please contact the admin.",0, 255, 50) 
                end 
            else 
                exports["guimessages"]:outputServer(source,"Account with this name already exists!",0, 255, 50) 
            end 
        else 
            exports["guimessages"]:outputServer(source,"You can register up to 3 accounts only!",0, 255, 50) 
        end 
    end 
end) 

Link to comment

يعني كذا؟

addEvent("Login-Register", true) 
addEventHandler("Login-Register", root, 
function(action, userName, passWord) 
    if (action == "Login") then 
        local account = getAccount(userName, passWord) 
        if account then 
            logIn(source, account, passWord) 
            triggerClientEvent(source, "onLoginSuccess", source) 
        else 
            exports["guimessages"]:outputServer(source,"Wrong username or password!",0, 255, 50) 
        end 
    elseif (action == "Register") then 
        local serial = getPlayerSerial(source) 
        local TotalAcc = TotalAccounts(serial) or 0 
        if TotalAcc < 3 then 
            if not getAccount(userName) then 
                local accountAdded = addAccount(userName, passWord) 
                if accountAdded then 
    spawnPlayer (source,1682.52588,-2327.87305,13.54688, 0,0, 0, 0) 
    setPlayerMoney (source, 100000) 
      setCameraTarget (source, source) 
      fadeCamera(source, false, 2.0)   
                    exports["guimessages"]:outputServer(source,"You have successfully registered!, you can now login with your username and password.",0, 255, 50) 
                    setAccountData(accountAdded, "reg-Serial", serial) 
                else 
                    exports["guimessages"]:outputServer(source,"Error creating account, please contact the admin.",0, 255, 50) 
                end 
            else 
                exports["guimessages"]:outputServer(source,"Account with this name already exists!",0, 255, 50) 
            end 
        else 
            exports["guimessages"]:outputServer(source,"You can register up to 3 accounts only!",0, 255, 50) 
        end 
    end 
end) 

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