Jump to content

Bad Argument on Register Panel


Sasu

Recommended Posts

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

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
line 7:
if (logIn(player, username, password) == true) then   

WARNING: MFLoginPanel\script.lua:46: Bad argument @ 'logIn' [Expected account at argument 2, got string]

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] :S

Link to comment

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

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