18.03.2011, 11:30
The file dosnt get created... (Unknown123.ini)
Why not?
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;
}
}