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



[SOLVED] IP login - strcmp - CAR - 23.04.2010

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.


Re: IP login - strcmp - [HiC]TheKiller - 23.04.2010

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

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



Re: IP login - strcmp - CAR - 23.04.2010

Lol, stupid mistake, Thank you!