Problem With INI
#1

Код:
Thien.pwn(138) : error 017: undefined symbol "PlayerInfo"
Thien.pwn(139) : error 017: undefined symbol "PlayerInfo"
Thien.pwn(140) : error 017: undefined symbol "PlayerInfo"
Thien.pwn(317) : error 028: invalid subscript (not an array or too many subscripts): "udb_hash"
Thien.pwn(317) : warning 215: expression has no effect
Thien.pwn(317) : error 001: expected token: ";", but found "]"
Thien.pwn(317) : error 029: invalid expression, assumed zero
Thien.pwn(317) : fatal error 107: too many error messages on one line
My Code
Код:
public OnPlayerDisconnect(playerid, reason)
{
	new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File, "data");
    INI_WriteInt(File, "Tien",GetPlayerMoney(playerid));
    INI_WriteInt(File, "Admin",PlayerInfo[playerid][pAdmin]);
    INI_WriteInt(File, "Diem",PlayerInfo[playerid][pDiem]);
    INI_WriteInt(File, "Vip", PlayerInfo[playerid][pVip]);
    INI_Close(File);
	return 1;
}
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	switch(dialogid)
	{
		case DIALOG_DANGKY:
		{
			if(!response) return Kick(playerid);
			if(response)
			{
				if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_DANGKY, DIALOG_STYLE_INPUT,"Dang Ky","Mat Khau Dang Ky Khong Hop Le, Hay Thu Cai Khac!","Dang Ky","Thoat");						
				new INI:File = INI_Open(UserPath(playerid));
				INI_SetTag(File, "data");
				INI_WriteInt(File, "Password",udb_hash[inputtext]);
				INI_WriteInt(File, "Tien",0);
				INI_WriteInt(File, "Admin",0);
				INI_WriteInt(File, "Diem",0);
				INI_WriteInt(File, "Vip",0);
				INI_Close(File);
			}
		}
		case DIALOG_DANGNHAP:
		{
			if(!response) return Kick(playerid);
			if(response)
			{
				if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid),"LoadUser_%s",.bExtra = true,.extra = playerid);
                    GivePlayerMoney(playerid,PlayerInfo[playerid][pTien]);
                    SetPlayerScore(playerid,PlayerInfo[playerid][pDiem]);
                    SendClientMessage(playerid,COLOR_YELLOW,"Dang Nhap Thanh Cong!");
                    SpawnPlayer(playerid);
                    TogglePlayerSpectating(playerid, 0);
                }
                else
                {
                    TogglePlayerSpectating(playerid, 1);
                    ShowPlayerDialog(playerid,DIALOG_DANGNHAP,DIALOG_STYLE_PASSWORD,"Dang Nhap","Sai Mat Khau Vui Long Nhap Dung","Dang Nhap","Thoat");
                }
			}
		}
	}
	return 1;
}
Код:
enum pInfo
{
	pPass,
	pTien,
	pAdmin,
	pDiem,
	pVip
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Reply
#2

any one ?
Reply
#3

udb_hash(inputtext);
you should use parentheses not square braces
and also udb hash is not safe and therefore it is not used in digital world now as its algorithm can be cracked easily.Use better hashing methods like sha256 .

And about first errors you should check the curly brackets and the order of your code if the usage appeared before declaration and the declaration is globally done.
Reply
#4

Quote:
Originally Posted by Sreyas
Посмотреть сообщение
udb_hash(inputtext);
you should use parentheses not square braces
and also udb hash is not safe and therefore it is not used in digital world now as its algorithm can be cracked easily.Use better hashing methods like sha256 .

And about first errors you should check the curly brackets and the order of your code if the usage appeared before declaration and the declaration is globally done.
i am follow this tutorials https://www.youtube.com/watch?v=dymEZTaAS9M
Reply
#5

Quote:
Originally Posted by TYDS
Посмотреть сообщение
Dont follow it as it is a complete crap.
Reply
#6

Quote:
Originally Posted by Sreyas
Посмотреть сообщение
Dont follow it its complete crap.
oh so how can i solve this problem
Reply
#7

Quote:
Originally Posted by TYDS
Посмотреть сообщение
oh so how can i solve this problem
i told you how to fix it...

But one thing if you want to learn Yini there is a tutorial by AndySedeyn which is ,in my opinion, the best out there.

Edit: here is the link https://sampforum.blast.hk/showthread.php?tid=597639
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)