login system bugged

Started by Strike Eagle, Sep 27, 2018, 05:41 AM

Previous topic - Next topic

Strike Eagle

please check

  else if ( ( cmd == "login" ) || ( cmd == "signin" ) )
  {
    if ( status[ player.ID ].Logged == true ) ErrorMessage( "you are already identified.",player );
    else if ( status[ player.ID ].Registered == false ) ErrorMessage( "[#FF0000][Server] - [#FFFFFF]you are not part of our community. please register by /register <password>",player);
    else if ( !text ) ErrorMessage(" [#FF0000][SYNTAX]: [#FFFFFF]/"+cmd+" <password>", player );
    else if ( SHA256( text ) != GetPassword( player ) ) ErrorMessage( "[#FF0000][Server] - [#FFFFFF]please enter valid password to continue.", player);
    else
    {
      Login( player, text );
    }
  }
Best Game Hosting ever for VCMP
https://gamehosting.co/aff.php?aff=112

Mahmoud Tornado

Might be, in ErrorMessage --> PlayerMessage. "If you didn't change it!"
Or you didn't add Login function!
Or status be like Status, or stats, or Stats.

Off-Topic: In anybug, add an photo to the error from the server log, and that line which have had the problem.

D4rkR420R

Can you at least show us your Login function? :c

=RK=MarineForce

#3
 =TRC=Kelvin

else if ( cmd == "login" )
 {
  if ( stats[ player.ID ].logged ) PrivMessage( player, "Error: You are already logged-in." );
  else if ( !text ) PrivMessage( player, format( "Error: Use /%s <password>", cmd ) );
  else if ( SHA256( text ) != GetSQLColumnData( QuerySQL( database, "SELECT password FROM account WHERE player = '" + player.Name.tolower() + "'" ), 0 ) ) PrivMessage( player, "INVALID PASSWORD." );
  else
  {
   local query = QuerySQL( database, "SELECT * FROM account WHERE player = '" + player.Name.tolower() + "'" );
   if ( query )
   {
    local KILLS = GetSQLColumnData( query, 3 ), DEATHS = GetSQLColumnData( query, 4 ), HEADSHOTS = GetSQLColumnData( query, 5 ), JOINS = GetSQLColumnData( query, 6 ), LEVEL = GetSQLColumnData( query, 8 );
    stats[ player.ID ].kills = KILLS.tointeger();
    stats[ player.ID ].deaths = DEATHS.tointeger();
    stats[ player.ID ].headshots = HEADSHOTS.tointeger();
    stats[ player.ID ].joins = JOINS.tointeger();
    stats[ player.ID ].level = LEVEL.tointeger();
    player.Cash = GetSQLColumnData( query, 7 ).tointeger();
    stats[ player.ID ].autologin = GetSQLColumnData( query, 9 ).tostring();
    stats[ player.ID ].joins++;
    stats[ player.ID ].registered = true;
    stats[ player.ID ].logged = true;
    PrivMessage( player, format( "Nickname:[ %s ] Kills:[ %d ] Deaths:[ %d ] Headshots:[ %d ] Level:[ %d ] Joins:[ %d ]", GetSQLColumnData( query, 0 ), KILLS.tointeger(), DEATHS.tointeger(), HEADSHOTS.tointeger(), LEVEL.tointeger(), JOINS.tointeger() ) );
    ClientMessageToAll( format( ">> %s has logged-in.", player.Name ), 0, 255, 0 );
   }
   else PrivMessage( player, "wtf" );
  }
 }

made one like this

Hello, Maiyan Bro

Your Command is clean no bugs but u didn't added function and database ,on playerpart You gave only Cmd otheR? functions