Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - SilentX

#1
no sseebbyy , that's the whole problem ,

QuerySQL( db, "INSERT INTO Account ( Name, IP, Level, Pass, Kills, Deaths, Cash, Bank, Joins, nogoto, DateRegistered, WonLMS, RandSpawn ) VALUES ( '" + player.Name.tolower() + "', '" + player.IP + "', '1', '" + pass + "', '0', '0', '0', '0', '0', 'off', '" + GetFullTime() + "', '0', 'on' )" );
when player registers the account , it suppose to add the value 1 as level on database

but it doesn't . instead of setting player's level to 1 on database it sets the level to value 0
and because of that reason script keeps asking to re register the account .

#2
yeah i noticed that mistake , and fixed it , but the situation is this one , and it seems thats the only problem.

accounts are getting saved in database with level 0 , instead of 1, and because of that , its always askin to re register the account , because when it gets saved , it wont add level 1, now if i update the level on database from 0  to 1 , everything goes fine

but it wont set account's level to 1 since the begining, so thats the problem
#3
even though i added the '1' instead of 1 ,

QuerySQL( db, "INSERT INTO Account ( Name, IP, Level, Pass, Kills, Deaths, Cash, Bank, Joins, nogoto, DateRegistered, WonLMS, RandSpawn ) VALUES ( '" + player.Name.tolower() + "', '" + player.IP + "', '1', '" + pass + "', '0', '0', '0', '0', '0', 'off', '" + GetFullTime() + "', '0', 'on' )" );

database still saving account with level 0
#4
and problem here is that for this bugged accounts , on database it saves with level 0 , instead of level 1.
#5
i have that also , see, it registered a few accounts with no problems , around 7, and those work fine , but then all of a sudden it started acting up

this is my on player join
function onPlayerJoin( player )
{
  ::AddAlias( player );
  local country = geoip_country_name_by_addr(player.IP),msg;
  if ( CheckPBan( player ) == 1 )
    {
        if ( BanNick[player.ID] != null )
        {
            local q = QuerySQL( db, "SELECT * FROM PBan WHERE Name='" + BanNick[player.ID] + "'" );
            if (q) Message( "*** "+player.Name+" ] fue expulzado por:[ " + GetSQLColumnData( q, 2 ) + "  ].");
            else Message( "*** "+player.Name+" fue expulzado por que su coneccion fue baneada del servidor.");
            MessagePlayer( msg.W + " your connection was banned from server", player );
            MessagePlayer( msg.W + " you must do a ban appel at, www.test.com", player );
            MessagePlayer( msg.W + " your current ip: " + player.IP + " your nick: " + player.Name + "- good bye.", player );
            MessagePlayer( msg.I + " www.test.com", player );
            FreeSQLQuery( q );
        }
        else Message( "*** "+player.Name+" was kicked , player is banned.");
        KickPlayer( player );
    }
    if ( NickBanned[player.ID] != null )
    {
        if ( CheckBanState( player, "true", NickBanned[player.ID] ) == 1 )
        {
            if ( BanNick[player.ID] != null )
            {
                local q = QuerySQL( db, "SELECT * FROM PBan WHERE Name='" + BanNick[player.ID] + "'" );
                if (q) Message( "*** "+player.Name+" banned due to:[ " + GetSQLColumnData( q, 2 ) + "  ].");
                FreeSQLQuery( q );
            }
            else
            {
                Message( "*** "+player.Name+" player is currently banned.");
            }
            KickPlayer( player );
        }
    }
   ::AccInfo( player );
  LoadSpawnwep(player);
  EchoMessage( "\x000313 -> "+ player.Name+" Established connection from " + country + ". [" + geoip_country_code_by_addr(player.IP) + "].");

}


and right here is my accinfo function
function AccInfo( player )
{

  db_account[ player.ID ] = Info();
  local id = player.ID;
  local ip = player.IP;
  if ( GetLevel( player ) >= 1 )
  {
      if ( ip != GetIP( player ) )
  {
            ClientMessage( " Welcome Back " + player.Name + " ", player,250,107,222 );
ClientMessage( " you have to login before you spawn", player,250,107,222 );
ClientMessage( " use command /login <pass>", player,250,107,222 );
  db_account[ player.ID ].Registed = true;
  db_account[ player.ID ].Logged = false;
  }
  else if ( ip == GetIP( player ) )
  {
       local q = QuerySQL( db, "SELECT * FROM Account WHERE Name='" + player.Name.tolower() + "'" );
   if ( GetSQLColumnData( q, 0 ) != null )
              {
db_account[ player.ID ].Level = GetSQLColumnData( q, 2 );
   db_account[ player.ID ].Kills = GetSQLColumnData( q, 4 );
   db_account[ player.ID ].Deaths = GetSQLColumnData( q, 5 );
   db_account[ player.ID ].Cash = GetSQLColumnData( q, 6 );
   db_account[ player.ID ].Bank = GetSQLColumnData( q, 7 );
   db_account[ player.ID ].Joins = GetSQLColumnData( q, 8 );
   }
   GetSQLNextRow( q );
   if ( db_account[ player.ID ].Level > 2 ) ::MessagePlayer( msg.W + " Your Account Was Succesfully identified as Admin - Level:[ " + db_account[ player.ID ].Level + " ]", player );
ClientMessage(  " Welcome Back " + player.Name + " ", player,250,107,222 );
ClientMessage(  " Your account was successfully identified!!", player, 250,107,222 );
ClientMessage(  " Current Stats " + db_account[ player.ID ].Kills + " Kills, " + db_account[ player.ID].Bank + " Bank", player,250,107,222 );
   db_account[ player.ID ].Registed = true;
   db_account[ player.ID ].Logged = true;
   db_account[ player.ID ].Joins++;
   
  }
 
  }
  else
  {
ClientMessage( ">> Welcome " + player.Name + "!", player,250,107,222 );
ClientMessage( " Please register your account on our system", player,250,107,222 );
ClientMessage( " Use  /register <pass>", player,250,107,222 ); 
  }

}


here's a pic from database , where u can see how many times i've registered that dummy account , and still was asking me to re register it

#6
Need some help here i've been struggling
when i use register command , it does register the account , the account also gets saved on the database with player's nick, but if player rejoin server , it will ask him to register again, and if it does then it'll just create another account on database with same nick, but problem still there , every time player joins the server it will ask him to re register again and again

if ( cmd == "register" )
  {
   if ( db_account[ player.ID ].Registed == true ) ePrivMessage( "[Error] - You're Already Registered!", player );
   else if ( !text ) ePrivMessage( "[Syntax] - /" + cmd + " <Password>", player );
   else
   {
        Register( player, text );
}
}


function Register( player, password )
{
    local pass = ::SHA256(password);
QuerySQL( db, "INSERT INTO Account ( Name, IP, Level, Pass, Kills, Deaths, Cash, Bank, Joins, nogoto, DateRegistered, WonLMS, RandSpawn ) VALUES ( '" + player.Name.tolower() + "', '" + player.IP + "', 1, '" + pass + "', 0, 0, 0, 0, 0, 'off', '" + GetFullTime() + "', 0, 'on' )" );
db_account[ player.ID ].Logged = true;
db_account[ player.ID ].Reg = true;
ClientMessage(  " Congratz , your account is been successfully registered", player,250,107,222 );
ClientMessage( " Remember your pass: [#FFFFFF][" + password + "]", player,250,107,222  );
ClientMessage( " you have recived 1000 cash", player,250,107,222  );
IncCash( player, 1000 );

}

function IncCash( player, amount )
{
      local cash = db_account[ player.ID ].Cash;
  local add = cash + amount;
  db_account[ player.ID ].Cash = add;
  player.Cash = add;
}