SA-MP Forums Archive
[SOLVED] Auto login - 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: [SOLVED] Auto login (/showthread.php?tid=120496)



[SOLVED] Auto login - KnooL - 11.01.2010

I'm trying to make an auto login that checks someones IP with the last logged in IP.
pawn Код:
if (udb_Exists(PlayerName(playerid))) {
  new playerip[16], playeripff[16];
  GetPlayerIp(playerid,playerip,16);
  playeripff = dUserINT(PlayerName(playerid)).("IP");
  if(playerip == playeripff) LoadFile(playerid);
    }
Код:
C:\server\gamemodes\beta.pwn(2490) : error 033: array must be indexed (variable "playeripff")
C:\server\gamemodes\beta.pwn(2491) : error 033: array must be indexed (variable "playerip")
these two lines:
Код:
C:\server\gamemodes\beta.pwn(2490) : error 033: array must be indexed (variable "playeripff")
C:\server\gamemodes\beta.pwn(2491) : error 033: array must be indexed (variable "playerip")
could someone help me out? thanks in advance!


Re: [UNSOLVED] Auto login - lameguy - 11.01.2010

you can look from JAdmin how to make it. (my signature)
There is script for it in OnPlayerConnect.


Re: [UNSOLVED] Auto login - KnooL - 11.01.2010

I reviewed it and tbh I don't like c&p + I couldn't see something that check for the players ip and it isn't made with dudb.

thanks anyway


Re: [UNSOLVED] Auto login - SiJ - 11.01.2010

Quote:
Originally Posted by KnooL
pawn Код:
if (udb_Exists(PlayerName(playerid))) {
  new playerip[16], playeripff[16];
  GetPlayerIp(playerid,playerip,16);
  format(playeripff,16,"%s",dUserINT(PlayerName(playerid)).("IP"));
  if(!strcmp(playerip,playeripff)) LoadFile(playerid);
    }
Use strcmp to compare two STRINGS.. == is for integers, and you cannot just assign value to string by doing playeripff = something; you MUST format it.. :P


Re: [UNSOLVED] Auto login - KnooL - 12.01.2010

thank you it works.