Cant save inputtext with y_ini HELP!
#1

I want to save someones email with y_ini but I cant..

Код:
enum pInfo
{
	pPass,
	pLevel,
	pSpawn,
	pAdmin,
	pSpol,
	pGodine,
	pPorijeklo,
	pNovac,
	pUbistva,
	pSmrti,
	CardOwner,
	pEmail[20]
}
new PlayerInfo[MAX_PLAYERS][pInfo];

PlayerInfo[playerid][pEmail]= strval(inputtext);
                format(PlayerInfo[playerid][pEmail], 20, "%s", inputtext);
                INI_WriteString(File, "Email", inputtext);
Reply
#2

It is saved correctly if you open the file, write and close it but you do store it to the variable wrong.

pawn Код:
strcat((PlayerInfo[playerid][pEmail][0] = EOS, PlayerInfo[playerid][pEmail]), inputtext, 20);
...
INI_WriteString(File, "Email", inputtext);
Reply
#3

It still doesnt save here is the whole code..

Код:
case DIALOG_PRAVILA:
        {
            if(!response) return Kick(playerid);
			if(response)
			{
   				new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                new HashPass[129];
				WP_Hash(HashPass, sizeof(HashPass), inputtext);
                INI_WriteString(File, "Password", HashPass);
                INI_WriteInt(File,"Novac",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Ubistva",0);
                INI_WriteInt(File,"Smrti",0);
                INI_WriteInt(File,"Level",0);
                new Godine = PlayerInfo[playerid][pGodine];
                INI_WriteInt(File,"Godine",Godine);
                new Porijeklo = PlayerInfo[playerid][pPorijeklo];
                INI_WriteInt(File,"Porijeklo",Porijeklo);
                new Spol = PlayerInfo[playerid][pSpol];
                INI_WriteInt(File,"Spol",Spol);
                strcat((PlayerInfo[playerid][pEmail][0] = EOS, PlayerInfo[playerid][pEmail]), inputtext, 20);
                INI_WriteString(File, "Email", inputtext);
                INI_Close(File);
			}
			return 1;
		}
Reply
#4

Is the above (DIALOG_PRAVILA) supposed to be the password or the email? Because inputtext can't hold both at the same time.

In the dialog about entering their email:
pawn Код:
strcat((PlayerInfo[playerid][pEmail][0] = EOS, PlayerInfo[playerid][pEmail]), inputtext, 20);
When saving:
pawn Код:
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteString(File, "Email", PlayerInfo[playerid][pEmail]);
INI_Close(File);
Reply
#5

Omg its finnaly working I tried everything I can find but this works now ty!
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)