automatic login fails - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: automatic login fails (
/showthread.php?tid=121121)
automatic login fails -
~Dangun! - 15.01.2010
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
Re: automatic login fails -
GTAguillaume - 15.01.2010
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;
}
Re: automatic login fails -
~Dangun! - 15.01.2010
Still "fake" logging me in.
Re: automatic login fails -
~Dangun! - 16.01.2010
bump
Re: automatic login fails -
KnooL - 16.01.2010
Use dudb, it's much easier then dini for account stuff like this.
Re: automatic login fails -
~Dangun! - 16.01.2010
i need to use dini, i don't feel like scripting everything again.
So i hope somebody will be able to help me.
Re: automatic login fails -
KnooL - 16.01.2010
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);
Re: automatic login fails -
~Dangun! - 16.01.2010
Код:
(2070) : warning 209: function "OnPlayerLogin" should return a value
Re: automatic login fails -
~Dangun! - 16.01.2010
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.
Re: automatic login fails -
~Dangun! - 16.01.2010
I joined under a non registered username. Still logging me in -_-