I've made a little register and login system with dini but it now dont create the file for everyone who registers!
Please help me.
Код:
if(dialogid == DIALOG_REGISTER)
{
if(!response)
{
Kick(playerid);
}
else if(response)
{
new str[256], file[256], buf[145], ip[16], date[20], year, month, day;
if (strlen(inputtext) < 4 || strlen(inputtext) > 20)
{
format(str, 956, ""white"The length of your password should contain "red"more\nthan 3 characters and less than 20 characters!\n\n"white"%s, Please, re-enter the password", GetName(playerid));
return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, ""white"Register!", str, "Register", "Exit");
}
format(file, sizeof(file), SavePath, GetName(playerid));
dini_Create(file);
getdate(year, month, day);
WP_Hash(buf, sizeof(buf), inputtext);
GetPlayerIp(playerid, ip, 16);
dini_Set(file, "Password", buf);
dini_Set(file, "Ip", ip);
format(date, sizeof(date), "%d/%d/%d", day, month, year);
dini_Set(file, "RegisteredDate", date);
dini_IntSet(file,"Loggedin",1);
dini_IntSet(file,"Banned", 0);
dini_IntSet(file,"Level", 0);
dini_IntSet(file,"LastOn", 0);
if(sInfo[SaveScore] == 1)
{
dini_IntSet(file,"Score", 0);
}
if(sInfo[SaveCash] == 1)
{
dini_IntSet(file,"Money", 0);
}
dini_IntSet(file,"Cookies", 0);
dini_IntSet(file,"Kills", 0);
dini_IntSet(file,"Deaths", 0);
dini_IntSet(file,"WantedLevel", 0);
dini_IntSet(file, "PM", 1);
dini_IntSet(file, "FavSkin", -1);
dini_IntSet(file, "UseSkin", 0);
dini_IntSet(file, "Mute", 0);
dini_IntSet(file, "MuteTime", 0);
dini_IntSet(file, "Frozen", 0);
dini_IntSet(file, "FreezeTime", 0);
dini_IntSet(file, "Jail", 0);
dini_IntSet(file, "JailTime", 0);
pInfo[playerid][Mute] = 0; pInfo[playerid][Frozen] = 0; pInfo[playerid][Jail] = 0;
pInfo[playerid][MuteTime] = 0; pInfo[playerid][FreezeTime] = 0; pInfo[playerid][JailTime] = 0;
pInfo[playerid][PM] = 1;
pInfo[playerid][LogIn] = 1;
pInfo[playerid][Banned] = 0;
pInfo[playerid][Admin] = 0;
pInfo[playerid][Money] = 0;
pInfo[playerid][Score] = 0;
pInfo[playerid][Kills] = 0;
pInfo[playerid][Deaths] = 0;
pInfo[playerid][Wanted] = 0;
pInfo[playerid][Cookies] = 0;
SendClientMessage(playerid, COLOR_GREEN, "SERVER: Registered and successfully logged in!");
format(str, sizeof(str), "Remember, Your account's password is: %s", inputtext);
SendClientMessage(playerid, COLOR_YELLOW, str);
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
return 1;
}
}