Y_ini Savin' Problem - 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: Y_ini Savin' Problem (
/showthread.php?tid=241618)
Y_ini Savin' Problem - Unknown123 - 18.03.2011
The file dosnt get created... (Unknown123.ini)
Why not?
pawn Код:
#define FILE_FOLDER "Accounts/%s.ini"
dcmd_register(playerid, params[])
{
new password[128];
if(sscanf(params, "s[128]", password)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /register (password)");
{
new PlayerFile[256];
format(PlayerFile, sizeof PlayerFile, FILE_FOLDER, Encode(PlayerName(playerid)));
new INI:PlayerAccount = INI_Open(PlayerFile);
INI_WriteString(PlayerAccount, "Name", PlayerName(playerid));
INI_WriteString(PlayerAccount, "Password", password);
INI_WriteString(PlayerAccount, "PlayerIP", PlayerIP(playerid));
INI_WriteInt(PlayerAccount, "AdminLevel", 0);
INI_WriteInt(PlayerAccount, "Score", 0);
INI_WriteInt(PlayerAccount, "Money", 0);
INI_WriteInt(PlayerAccount, "Kills", 0);
INI_WriteInt(PlayerAccount, "Deaths", 0);
INI_Close(PlayerAccount);
SendClientMessage(playerid, 0xFF0000FF, "Registred!");
return 1;
}
}
Re: Y_ini Savin' Problem -
HyperZ - 18.03.2011
pawn Код:
#define FILE_FOLDER "Accounts/%s.ini"
dcmd_register(playerid, params[])
{
new password[128];
if(sscanf(params, "s[128]", password)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /register (password)");
new PlayerFile[ 13 + MAX_PLAYER_NAME ];
format(PlayerFile, sizeof PlayerFile, FILE_FOLDER, Encode(PlayerName(playerid)));
new INI:PlayerAccount = INI_Open(PlayerFile);
INI_WriteString(PlayerAccount, "Name", PlayerName(playerid));
INI_WriteString(PlayerAccount, "Password", password);
INI_WriteString(PlayerAccount, "PlayerIP", PlayerIP(playerid));
INI_WriteInt(PlayerAccount, "AdminLevel", 0);
INI_WriteInt(PlayerAccount, "Score", 0);
INI_WriteInt(PlayerAccount, "Money", 0);
INI_WriteInt(PlayerAccount, "Kills", 0);
INI_WriteInt(PlayerAccount, "Deaths", 0);
INI_Close(PlayerAccount);
SendClientMessage(playerid, 0xFF0000FF, "Registred!");
return 1;
}
Re: Y_ini Savin' Problem - Unknown123 - 18.03.2011
Still not working =/
EDIT: Is it possible to Enable/Disable file writing? Because GarHouse is not saving too =/ it says the house is saved.. but nothing
Re: Y_ini Savin' Problem -
HyperZ - 18.03.2011
Make sure that you have "Accounts" folder in scriptfiles.
Re: Y_ini Savin' Problem - Unknown123 - 18.03.2011
Quote:
Originally Posted by Clive
Make sure that you have "Accounts" folder in scriptfiles.
|
I have.
"scriptfiles/Accounts/(Accounts empty folder)"
Re: Y_ini Savin' Problem -
HyperZ - 18.03.2011
Quote:
Originally Posted by Unknown123
I have.
"scriptfiles/Accounts/(Accounts empty folder)"
|
I edited my post try that code again.
Re: Y_ini Savin' Problem - Unknown123 - 18.03.2011
Not working