Y_ini bugs , Password is not showing ++Rep
#1

In the Users file , the password and the Admin lvl are supposed to show up , but the admin lvl is not there and the password is shown as 0 , this system is exactly coppied from a tut , i dont have the link tho

stats:
Код:
[data]
Cash = 0
Score = 0
Kills = 0
Password = 0
Deaths = 0
RectionTests = 0
Moneybags = 0
Warned = 0
Kicked = 0
Banned = 0
Script
Код:
enum pInfo
{
    pPass,
    pAdmin,
    pScore,
    pCash,
    pKills,
    pDeaths,
    pReactionTests,
    pMoneyBags,
    pWarned,
    pKicked,
    pBanned
}
new PlayerInfo[MAX_PLAYERS][pInfo];

forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
	INI_Int("Password",PlayerInfo[playerid][pPass]);
	INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
	INI_Int("Score",PlayerInfo[playerid][pScore]);
	INI_Int("Cash",PlayerInfo[playerid][pCash]);
	INI_Int("Kills",PlayerInfo[playerid][pKills]);
    INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    INI_Int("ReactionTests",PlayerInfo[playerid][pReactionTests]);
    INI_Int("MoneyBags",PlayerInfo[playerid][pMoneyBags]);
    INI_Int("Warned",PlayerInfo[playerid][pWarned]);
    INI_Int("Kicked",PlayerInfo[playerid][pKicked]);
    INI_Int("Banned",PlayerInfo[playerid][pBanned]);
 	return 1;
}

public OnPlayerConnect(playerid)
{
	if(fexist(UserPath(playerid)))
	{
		INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
		ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"{FFFFFF}Registering...","{FFFFFF}Type your password below to register a new account.","Register","Quit");
	}
	else
	{
 		ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"{FFFFFF}Registering...","{FFFFFF}Type your password below to register a new account.","Register","Quit"); //Line 522
	}

	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	new INI:File = INI_Open(UserPath(playerid));
	INI_SetTag(File,"data");
	INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
	INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
	INI_WriteInt(File,"Score",PlayerInfo[playerid][pScore]);
	INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
	INI_WriteInt(File,"Password",PlayerInfo[playerid][pPass]);
	INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
	INI_WriteInt(File,"RectionTests",PlayerInfo[playerid][pReactionTests]);
	INI_WriteInt(File,"Moneybags",PlayerInfo[playerid][pMoneyBags]);
	INI_WriteInt(File,"Warned",PlayerInfo[playerid][pWarned]);
	INI_WriteInt(File,"Kicked",PlayerInfo[playerid][pKicked]);
	INI_WriteInt(File,"Banned",PlayerInfo[playerid][pBanned]);
	INI_Close(File);

	return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 4 Guest(s)