22.06.2014, 09:06
(
Последний раз редактировалось Stinged; 22.06.2014 в 17:04.
)
Well I don't really know how to explain this, but I was making a new gamemode.
I started off with making a registration system, but I found a bug.
If I click on "Quit" before registering, for some reason it's creating the .ini file, but empty.
And that would stop me from registering, and will ask me to login.
I started off with making a registration system, but I found a bug.
If I click on "Quit" before registering, for some reason it's creating the .ini file, but empty.
And that would stop me from registering, and will ask me to login.
pawn Код:
case DIALOG_REGISTER:
{
if(!response)
return Kick(playerid);
if(response)
{
if(strlen(inputtext) < 3 || strlen(inputtext) > 32)
return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Registering...", "Welcome to the server!\nPlease enter a password to register.\n\n{FF0000}The password must be between 3 and 32 characters.", "Register", "Quit");
new hashedpass[129];
WP_Hash(hashedpass, sizeof (hashedpass), inputtext);
new INI:file = INI_Open(UserPath(playerid));
INI_WriteString(file, "Password", hashedpass);
INI_WriteInt(file, "Admin", 0);
INI_WriteInt(file, "Money", 0);
INI_WriteInt(file, "Score", 0);
INI_WriteInt(file, "Kills", 0);
INI_WriteInt(file, "Deaths", 0);
INI_Close(file);
// Rest of the code
}
}