Sasu Posted February 25, 2013 Share Posted February 25, 2013 function registerHandler(player, username, password) local account = getAccount(username, password) if (account ~= false) then triggerClientEvent(player, "registerTaken", getRootElement()) else addAccount (username, password) if (logIn(player, account, password) == true) then triggerClientEvent(player, "hideLoginWindow", getRootElement()) showChat( source, true) setTimer ( fadeCamera, 50, 1, source,false, 1 ) exports["Evo-notificaciones"]:showBox ( source, "warning", "Bienvenido Al Server Su No Apareses Reconnecta /reconnect Y Si Apareses En Un Edificio Tirate Y Lee F1 Esperamos Que Tengas Una Buena Convivencia Con El Server." ) setTimer ( fadeCamera, 1000, 1, source,true, 3 ) setTimer( spawnPlayer, 1600,1,source, 1682.6030273438, -2327.3889160156, 13.546875) setTimer(setCameraMatrix,1500,1,source, 808,-1351,-0.4,-1000,0,0,0,0) setTimer(setElementRotation,2251,1,source,0,0,220) end end end Hi all! I have a problem on Console with this script. WARNING: MFLoginPanel\script.lua:46: Bad argument @ 'logIn' [Expected account at argument 2, got boolean] Please, Can any person help me? Link to comment
Sparrow Posted February 25, 2013 Share Posted February 25, 2013 line 7: if (logIn(player, username, password) == true) then Link to comment
Jaysds1 Posted February 25, 2013 Share Posted February 25, 2013 try this: function registerHandler(player, username, password) local account = getAccount(username, password) if account then triggerClientEvent(player, "registerTaken", getRootElement()) else account = addAccount (username, password) --replace the account var with this if logIn(player, account, password) then triggerClientEvent(player, "hideLoginWindow", getRootElement()) showChat( source, true) setTimer ( fadeCamera, 50, 1, source,false, 1 ) exports["Evo-notificaciones"]:showBox ( source, "warning", "Bienvenido Al Server Su No Apareses Reconnecta /reconnect Y Si Apareses En Un Edificio Tirate Y Lee F1 Esperamos Que Tengas Una Buena Convivencia Con El Server." ) setTimer ( fadeCamera, 1000, 1, source,true, 3 ) setTimer( spawnPlayer, 1600,1,source, 1682.6030273438, -2327.3889160156, 13.546875) setTimer(setCameraMatrix,1500,1,source, 808,-1351,-0.4,-1000,0,0,0,0) setTimer(setElementRotation,2251,1,source,0,0,220) end end end Link to comment
Sasu Posted February 25, 2013 Author Share Posted February 25, 2013 Sparrow said: line 7: if (logIn(player, username, password) == true) then WARNING: MFLoginPanel\script.lua:46: Bad argument @ 'logIn' [Expected account at argument 2, got string] Jaysds1 said: try this:function registerHandler(player, username, password) local account = getAccount(username, password) if account then triggerClientEvent(player, "registerTaken", getRootElement()) else account = addAccount (username, password) --replace the account var with this if logIn(player, account, password) then triggerClientEvent(player, "hideLoginWindow", getRootElement()) showChat( source, true) setTimer ( fadeCamera, 50, 1, source,false, 1 ) exports["Evo-notificaciones"]:showBox ( source, "warning", "Bienvenido Al Server Su No Apareses Reconnecta /reconnect Y Si Apareses En Un Edificio Tirate Y Lee F1 Esperamos Que Tengas Una Buena Convivencia Con El Server." ) setTimer ( fadeCamera, 1000, 1, source,true, 3 ) setTimer( spawnPlayer, 1600,1,source, 1682.6030273438, -2327.3889160156, 13.546875) setTimer(setCameraMatrix,1500,1,source, 808,-1351,-0.4,-1000,0,0,0,0) setTimer(setElementRotation,2251,1,source,0,0,220) end end end WARNING: MFLoginPanel\script.lua:46: Bad argument @ 'logIn' [Expected account at argument 2, got boolean] Link to comment
pNine Posted February 25, 2013 Share Posted February 25, 2013 It seems like theres already an account with that name, so it returns a boolean at line 6. Link to comment
Sasu Posted February 25, 2013 Author Share Posted February 25, 2013 pNine said: It seems like theres already an account with that name, so it returns a boolean at line 6. I cant understand very well. Link to comment
Vision Posted February 25, 2013 Share Posted February 25, 2013 Try this function registerHandler(player, username, password) local account = getAccount(username, password) if account then triggerClientEvent(player, "registerTaken", getRootElement()) else account = addAccount (username, password) --replace the account var with this if ( logIn ( player, account, password ) == true ) then triggerClientEvent(player, "hideLoginWindow", getRootElement()) showChat( source, true) setTimer ( fadeCamera, 50, 1, source,false, 1 ) exports["Evo-notificaciones"]:showBox ( source, "warning", "Bienvenido Al Server Su No Apareses Reconnecta /reconnect Y Si Apareses En Un Edificio Tirate Y Lee F1 Esperamos Que Tengas Una Buena Convivencia Con El Server." ) setTimer ( fadeCamera, 1000, 1, source,true, 3 ) setTimer( spawnPlayer, 1600,1,source, 1682.6030273438, -2327.3889160156, 13.546875) setTimer(setCameraMatrix,1500,1,source, 808,-1351,-0.4,-1000,0,0,0,0) setTimer(setElementRotation,2251,1,source,0,0,220) end end end Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now