SA-MP Forums Archive
Cant save inputtext with y_ini HELP! - 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: Cant save inputtext with y_ini HELP! (/showthread.php?tid=575226)



Cant save inputtext with y_ini HELP! - baba1234 - 24.05.2015

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);



Re: Cant save inputtext with y_ini HELP! - Konstantinos - 24.05.2015

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);



Re: Cant save inputtext with y_ini HELP! - baba1234 - 24.05.2015

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;
		}



Re: Cant save inputtext with y_ini HELP! - Konstantinos - 24.05.2015

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);



Re: Cant save inputtext with y_ini HELP! - baba1234 - 24.05.2015

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