Dini doesn't create the file - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Dini doesn't create the file (
/showthread.php?tid=235891)
Dini doesn't create the file -
pantelimonfl - 06.03.2011
I tryied to make a register system on a fs but dini did't create the files, then i made the fs a gamemode, and the same problem. I tryied even with Zh3r0's register system with Y_INI and the same problem.
pawn Код:
public OnPlayerRegister(playerid, password[])
{
if(IsPlayerConnected(playerid))
{
new string3[64];
new playername3[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername3, sizeof(playername3));
format(string3, sizeof(string3), "Accounts/%s.ini", playername3);
dini_Create(string3);
new password2 = num_hash(password);
PlayerInfo[playerid][Pass] = password2;
dini_IntSet(string3, "Password",password2);
dini_IntSet(string3, "Level",PlayerInfo[playerid][Level]);
dini_IntSet(string3, "Money",PlayerInfo[playerid][Money]);
ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_INPUT,""ALB"Bun Venit",""ALB"Cont inregistrat cu succes!\n"ALB"Scrie parola ta mai jos pentru a te loga","Log-in","Quit");
}
return 1;
}
Re: Dini doesn't create the file -
Stigg - 06.03.2011
Try:
Код:
dini_IntSet(File, ....
Re: Dini doesn't create the file -
Shadow™ - 06.03.2011
pawn Код:
public OnPlayerRegister(playerid, password) // [] isn't needed as the password is a integer (whole number)
{
if(IsPlayerConnected(playerid))
{
new file[64];
new playername3[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername3, sizeof(playername3));
format(file, sizeof(file), "Accounts/%s.ini", playername3);
if(dini_Exists(file))
{
return SendClientMessage(playerid,COLOR_WHITE,"This account is already registered.");
}
else
{
dini_Create(file);
new password2 = num_hash(password);
PlayerInfo[playerid][Pass] = password2;
dini_IntSet(file, "Password",password2);
dini_IntSet(file, "Level",PlayerInfo[playerid][Level]);
dini_IntSet(file, "Money",PlayerInfo[playerid][Money]);
ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_INPUT,""ALB"Bun Venit",""ALB"Cont inregistrat cu succes!\n"ALB"Scrie parola ta mai jos pentru a te loga","Log-in","Quit");
}
}
return 1;
}
Re: Dini doesn't create the file -
pantelimonfl - 06.03.2011
same problem
Re: Dini doesn't create the file -
chrism11 - 12.04.2011
it wont create the folder, you have to make it yourself, it will make .ini and .txt tho, just create a file named
Accounts and it should work