[SOLVED] IP login - strcmp
#1

Yes, I searched and by all was the answer that you must do it with strcmp but it doesn't work by me:

pawn Код:
GetPlayerName(playerid, playerNM, sizeof(playerNM));
  format(account, sizeof(account), "%s.txt", playerNM);
  if(dini_Exists(account))
  {
   GetPlayerIp(playerid, playerIP, sizeof(playerIP));
   format(fileIP, sizeof(fileIP), "%s", dini_Get(account, "IP"));
   if(!strcmp(fileIP == playerIP)) // line 45
   {
     Logged[playerid] = 1;
     format(Message, sizeof(Message), "[ACCOUNT]: %s, you're succesfully logged in!", playerNM);
     SendClientMessage(playerid, groen, Message);
   }
// rest of code...
Код:
..\filterscripts\login.pwn(45) : error 033: array must be indexed (variable "fileIP")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

1 Error.
If I change fileIP to playerIP and playerIP to fileIP I get the same error but than with (variable "playerIP") at the end.
Reply
#2

pawn Код:
if(!strcmp(fileIP == playerIP))
To

pawn Код:
if(!strcmp(fileIP, playerIP))
Reply
#3

Lol, stupid mistake, Thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)