automatic login fails
#1

I am using this code. When i enter my server it isn't logging my automaticly in.

pawn Код:
public OnPlayerConnect(playerid)
{

  new IP[56];
  new name2[MAX_PLAYER_NAME];
  GetPlayerName(playerid, name2, sizeof(name2));
  new string2[90];
  GetPlayerIp(playerid, IP, 56);
  format(string2, sizeof(string2), "IP=%s", dini_Get(name2, "IP"));
  if(strcmp(string2, IP, true)) { OnPlayerLogin(playerid); }
  return 1;
}


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

public OnPlayerLogin(playerid)
{
  new string[265];
  new IP[56];
  GetPlayerIp(playerid, IP, 56);
  dini_Set(udb_encode(pInfo[playerid][name]), "IP", IP);
}
It is fake logging me in also. http://i47.tinypic.com/hrnehu.jpg
Reply
#2

pawn Код:
format(string2, sizeof(string2), "IP=%s", dini_Get(name2, "IP"));
Why this?
Код:
if(strcmp(string2, IP, true))
You forgot a '!'.
pawn Код:
public OnPlayerConnect(playerid)
{

  new IP[56];
  new name2[MAX_PLAYER_NAME];
  GetPlayerName(playerid, name2, sizeof(name2));
  GetPlayerIp(playerid, IP, 56);
  if(!strcmp(dini_Get(name2, "IP"), IP, true)) { OnPlayerLogin(playerid); }
  return 1;
}
Reply
#3

Still "fake" logging me in.
Reply
#4

bump
Reply
#5

Use dudb, it's much easier then dini for account stuff like this.
Reply
#6

i need to use dini, i don't feel like scripting everything again.

So i hope somebody will be able to help me.
Reply
#7

pawn Код:
new playerip[16], playeripff[16];
  GetPlayerIp(playerid,playerip,16);
  format(playeripff,16,"%s",dini_Get(name2, "IP"));
  if(!strcmp(playerip,playeripff)) return OnPlayerLogin(playerid);
Reply
#8

Код:
(2070) : warning 209: function "OnPlayerLogin" should return a value
Reply
#9

Ok. Now when i connect to the server it's logging me in. But not getting my stats.
When i try to /login now it says: You are already logged in. So it's only not getting my stats yet.
Reply
#10

I joined under a non registered username. Still logging me in -_-
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)