Cant Join Server

Started by PsyChO_KiLLeR, Mar 01, 2015, 01:25 PM

Previous topic - Next topic

PsyChO_KiLLeR

Description: Well i am facing very big problem that i cant join my server when i open my server and try to go in it give me error in console and get Disconnected

ScreenShots of error: Error in Console 

 and error in server


FunctionOnPlayerJoin: I Think maybe something error on player join so i put the whole onplayerjoin here function onPlayerJoin( player )
{   
    AccInfo(player);
    local IP = player.IP;
    ePrivMessage("--> " + player.Name + " Connecting From: "+ IpToCountry( IP )+" ",player );
}

EK.IceFlake

And code of ePrivMessage and AccInfo?

PsyChO_KiLLeR

yeah sure

Code of ePrivMessage: function ePrivMessage( text, player )
{
    ClientMessage( "** pm >> " + text, player, 255, 165, 0 );
}

Code of Accinfo: function AccInfo( player )
{
      try{
  EchoMessage( ICOL_ORANGE + "** [" + player.ID + "] " + player.Name + " Joined the Server." );
  if ( CheckBan( player ) == 1 ) Kick( player, "Server", "Banned From Server" );
  status[ player.ID ] = PlayerStats();
  local id = player.ID;
  local ip = player.IP;
  if ( GetLevel( player ) > 0 )
  {
      if ( ip != GetIP( player ) )
  {
      ePrivMessage( "Welcome to the Server " + player.Name + "!", player );
  ePrivMessage( "Script Death-Match By Samar", player );
  ePrivMessage( "You're Not Logged-In. Please login by /login <password>", player );
  status[ player.ID ].IsReg = true;
  status[ player.ID ].IsLogged = false;
  }
  else if ( ip == GetIP( player ) )
  {
       local q = QuerySQL( db, "SELECT * FROM Account WHERE Name='" + player.Name.tolower() + "'" );
   if ( GetSQLColumnData( q, 0 ) != null )
              {
   status[ player.ID ].Kills = GetSQLColumnData( q, 4 );
   status[ player.ID ].Deaths = GetSQLColumnData( q, 5 );
   status[ player.ID ].Cash = GetSQLColumnData( q, 6 );
   status[ player.ID ].Bank = GetSQLColumnData( q, 7 );
   status[ player.ID ].Level = GetSQLColumnData( q, 2 );
   }
   GetSQLNextRow( q );
   ePrivMessage( "Welcome to the Server " + player.Name + "!", player );
   ePrivMessage( "Welcome To The  Dm Server", player );
   ePrivMessage( "You've Auto-Logged in onto the Server!", player );
   status[ player.ID ].IsReg = true;
   status[ player.ID ].IsLogged = true;
   EchoMessage( ICOL_BROWN + ">> " + player.Name + " Auto-Logged In." );
   
  }
 
  }
  else
  {
      ePrivMessage( "Welcome to the Server " + player.Name + "!", player );
  ePrivMessage( "Script Death-Match By Killer", player );
  ePrivMessage( "You're Not Registered with us. Register by /register <password>", player );   
  }
  WriteIniString( "Files/ServData.ini", "IP", player.Name, player.IP );
  }
  catch(e) print( "AccInfo Error: " + e );
}



Here's

EK.IceFlake

Which line is the error happening? Write //<<error happen here to that line.

PsyChO_KiLLeR

you can see the screen shot there is no line of error

.

Somewhere in your code you are sending the wrong number of parameters to a function. I'm busy to look for the exact place where this happens and I'm also missing the pieces to debug your script. Try printing something after key lines of code like having breakpoints to see where the execution stops.
.

Kratos_


I found an issue here . ePrivMessage function have been given RGB values instead of HEX color codes . I aint sure that whether it accepts RGB codes too or not cuz I haven't gone in game since 9 months so I couldn't test this feature .  < If someone is sure about this
RGB stuff then correct me if I'm wrong here > .

Interesting , its kicking you when user login gets failed . However , it should do so only when you're banned from your server. ( Your AccInfo function says so )  . Probably , we need function onplayerjoin as well . But , first try to convert that into HEX format .

In the middle of chaos , lies opportunity.

Sebastian

#7
Quote from: Kratos_ on Mar 01, 2015, 02:44 PMI aint sure that whether it accepts RGB codes too or not cuz I haven't gone in game since 9 months so I couldn't test this feature .  < If someone is sure about this
RGB stuff then correct me if I'm wrong here > .

From stormeus' bitbucket:
void ClientMessage(const SQChar * message, CPlayer * player, int r, int g, int b)

Even if it says that, I will test it and come with an edit.
I'm using only Message / MessagePlayer since we can add multiple colors on a message. :)

EDIT:
Yep, it works with RGB colors too.

Fuzzie

RGB values does work on ClientMessage.

Thijn

Do you have a onPlayerConnect function somewhere? If so, post it.

PsyChO_KiLLeR

nope thijn there is no function of onPlayerConnect

.

Quote from: PsyChO_KiLLeR on Mar 01, 2015, 03:21 PMnope thijn there is no function of onPlayerConnect


It's actually onPlayerJoin but Thijn used the name used in the plugin SDK :)
.

Kratos_

Quote from: sseebbyy on Mar 01, 2015, 02:51 PMEDIT: Yep, it works with RGB colors too.

Quote from: Fuzzie on Mar 01, 2015, 02:58 PMRGB values does work on ClientMessage.

Thanx both of you for the notification .  :)

Quote from: PsyChO_KiLLeR on Mar 01, 2015, 03:21 PMnope thijn there is no function of onPlayerConnect

Then, where your AccInfo is called in the script ?



I found an issue with your AccInfo function . If someone would be banned from the server & he attempt to rejoin with the same IP then he will auto-login into the server or may get an opportunity to login . But , he wouldn't gain the advantage of that auto-login cuz he is about to kick from the server . But , you need to fix that stuff as well .
In the middle of chaos , lies opportunity.

PsyChO_KiLLeR

ok but what about this problem?

Kratos_

Quote from: Kratos_ on Mar 01, 2015, 02:44 PMProbably , we need function onplayerjoin as well .
In the middle of chaos , lies opportunity.