Pipee20k Posted June 30, 2015 Share Posted June 30, 2015 Bueno, pues como dice el título, quiero hacer que los usuarios sólo puedan crear una cuenta por serial ya que con el tiempo van creando varias cuentas por usuario, la idea sería hacer un script a parte que no dependa del loginpanel (si se puede) La verdad es que no tengo ni idea de como hacerlo, alguien me podría guiar? Link to comment
Tomas Posted June 30, 2015 Share Posted June 30, 2015 Deberás editar el login panel, no veo otra opción. #getAccountsBySerial ( getPlayerSerial ( client ) ); Link to comment
Pipee20k Posted July 4, 2015 Author Share Posted July 4, 2015 function registerPlayer(source,username,password,passwordConfirm) local serial = getPlayerSerial (source) local otherAccounts = getAccountsBySerial(serial) if not otherAccounts then 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 ("[username: #FFFFFF" .. username .. " #00FF00| Password: #FFFFFF" .. password .. "#00FF00 ]",source,255,255,255,true ) else --triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","Error! Please try again with new username or password!") triggerClientEvent(source,"registerNot",getRootElement(),"Register","Error! Please try again with new username or password!") end else --triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","This username already taken!") triggerClientEvent(source,"registerNot",getRootElement(),"Register","This username already taken!") end else --triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","The passwords does not match!") triggerClientEvent(source,"registerNot",getRootElement(),"Register","The passwords does not match!") end else --triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","Please confirm your password!") triggerClientEvent(source,"registerNot",getRootElement(),"Register","Please confirm your password!") end else --triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","Please enter yout password!") triggerClientEvent(source,"registerNot",getRootElement(),"Register","Please enter yout password!") end else --triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","Please enter your username!") triggerClientEvent(source,"registerNot",getRootElement(),"Register","Please enter your username!") end else triggerClientEvent(source,"registerNot",getRootElement(),"Register","You already have an account, if you forgot your password or need a new account contact an administrator.") end end addEvent("onRequestRegister",true) addEventHandler("onRequestRegister",getRootElement(),registerPlayer) Intente algo asi (se me perdio el codigo y no recuerdo como lo habia puesto exactamente) y me decia que el getPlayerSerial devolvia un string "(nombre de la cuenta)" :c Link to comment
Recommended Posts