[SOLVED] Auto login
#1

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!
Reply
#2

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

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
Reply
#4

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
Reply
#5

thank you it works.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)