SA-MP Forums Archive
Register Help please +1 if u help - 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)
+--- Thread: Register Help please +1 if u help (/showthread.php?tid=596749)



Register Help please +1 if u help - ironmen - 22.12.2015

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.
Here is the code for the register and save:
Код:
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;
		}
	}
I will +rep for anyone who helps!
Please help me!
Thanks


Re: Register Help please +1 if u help - xTURBOx - 22.12.2015

y_ini is much faster than dini and more efficient


Re: Register Help please +1 if u help - ironmen - 22.12.2015

Quote:
Originally Posted by xTURBOx
Посмотреть сообщение
y_ini is much faster than dini and more efficient
I didn't learn to use it yet.


Re: Register Help please +1 if u help - xTURBOx - 22.12.2015

show the SavePath