29.07.2013, 22:29
Hi. I have problem with user registration.
When I join my server, dialog will be shown, and two buttons "Register" and "Quit", and when I press "Quit" without filling any password I got kick. Which is normal. But in "Users" folder "Name.ini" is created. I would like it like, when I press "Quit" there is no .ini file in "Users" folder. Hope you understood.
When I join my server, dialog will be shown, and two buttons "Register" and "Quit", and when I press "Quit" without filling any password I got kick. Which is normal. But in "Users" folder "Name.ini" is created. I would like it like, when I press "Quit" there is no .ini file in "Users" folder. Hope you understood.
pawn Код:
if(dialogid == UserRegister)
{
if(!response) return Kick(playerid);
}
if(response)
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid, UserRegister, DIALOG_STYLE_INPUT, "Register", "Welcome back to {"DialogRed"}eGaming Roleplay{"DialogText"}.\n\nEnter your password to register.", "Register", "Quit");
return 1;
}
new hashpass[129];
WP_Hash(hashpass, sizeof(hashpass), inputtext);
new INI:file = INI_Open(Path(playerid));
INI_SetTag(file, "Player's Data");
INI_WriteString(file, "Password", hashpass);
INI_WriteInt(file,"AdminLevel", 0);
INI_WriteInt(file,"VIPLevel", 0);
INI_WriteInt(file,"Money", 0);
INI_WriteInt(file,"Scores", 0);
INI_WriteInt(file,"Kills", 0);
INI_WriteInt(file,"Deaths", 0);
INI_WriteInt(file, "Skin", -1);
INI_Close(file);
SendClientMessage(playerid, YELLOW, "You have been successfully registered.");
SetPlayerColor(playerid, WHITE);
return 1;
}
}