SA-MP Forums Archive
Need help with Warning 221 (Y_INI) - 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)
+--- Thread: Need help with Warning 221 (Y_INI) (/showthread.php?tid=381582)



Need help with Warning 221 (Y_INI) - Rub0Gameton - 30.09.2012

Okay so it has been around an hour since I have been trying to fix this error. Guess I will post it here and see if anyone is able to help. It would be greatly appreciated. I am using y_ini (and yes, it is included).

Error: (I believe the first one is causing the rest of them.)
Quote:

(100) : warning 221: label name "INI" shadows tag name
(100) : error 017: undefined symbol "file"
(101) : error 017: undefined symbol "file"
(102) : error 017: undefined symbol "file"
(100) : warning 203: symbol is never used: "INI"

I also tried to find any other text matching with "INI", but everything I found is in this code...

Код:
#include <YSI\y_ini> /* ... Stuff ...*/

public Register(playerid,inputtext[])
{
	new filepath[128],pname[24];
	GetPlayerName(playerid,pname,sizeof(pname));
	format(filepath,sizeof(filepath),USERPATH,pname);
	
	INI:myfile = INI_Open(filepath); // Error line
	INI_WriteString(myfile, "password", inputtext);
	INI_Close(myfile);
	
	SendClientMessage(playerid,COLOR_GREEN,"You have been registered. Welcome to the server!");
	return 1;
}
EDIT: ****** didn't help either.


Re: Need help with Warning 221 (Y_INI) - trapstar2020 - 30.09.2012

https://sampforum.blast.hk/showthread.php?tid=273088


Re: Need help with Warning 221 (Y_INI) - Rub0Gameton - 30.09.2012

Quote:
Originally Posted by trapstar2020
Посмотреть сообщение
That's the tutorial I am basing it off. Took a second look at the code. It is pretty much the same approach.


Re: Need help with Warning 221 (Y_INI) - zDevon - 30.09.2012

Simple fix here, unless something else is wrong. Change
pawn Код:
INI:myfile = INI_Open(filepath); // Error line
to
pawn Код:
new INI:myfile = INI_Open(filepath); // Error line
Also, that code there is storing the password in plain readable text. The tutorial posted here has a simple hashing system included which I would recommend looking at.


Re: Need help with Warning 221 (Y_INI) - Rub0Gameton - 30.09.2012

Okay I really can't believed I actually wasted 3 hours of my entire life trying to figure out what was going on with my script. Well, guess who forgot to put a "new" before the variable declaration? I am extremely sorry to have wasted anybody else's time. Next time I will post after 5 hours.

EDIT: Oh look, someone posted the answer while I was typing this. Thanks to you for figuring out too, I guess. Guess I owe you some rep for that. Enjoy it!

EDIT2: Don't worry about the password. I use a custom encryption method that I doubt anyone has heard about. I excluded it of this for security purposes.


Re: Need help with Warning 221 (Y_INI) - zDevon - 30.09.2012

Aha, great. Happy scripting.