SA-MP Forums Archive
Faster Registration/.ini file creation - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Faster Registration/.ini file creation (/showthread.php?tid=145372)



Faster Registration/.ini file creation - Deji - 02.05.2010

Continuing my learning of Pawn, yet again.

I've created a registration for my site, however the ini file creation is very slow.

Код:
		  GetPlayerIp(playerid, ip, sizeof(ip));
		  dini_Create(file);
		  dini_IntSet(file, "AdminLevel",  0);
		  dini_IntSet(file, "Bank",  	 250);
		  dini_IntSet(file, "Cash",  	 500);
		  dini_Set  (file, "IP",  	 	 ip);
		  dini_IntSet(file, "Job",  	 0);
		  dini_IntSet(file, "Level",    0);
		  dini_IntSet(file, "Loan",     0);
		  dini_IntSet(file, "Password",   udb_hash(password));

		  PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);

		  gPlayerLogged[playerid] = 1;
		  SendClientMessage(playerid, COLOR_SUCCESS, "Account created! You have been automatically logged in.");

		  printf("%s registered account.", name);
I'm not sure which bit in specific is slow. But I'm wondering if there's a faster way of setting .ini's than dini?

Also if there's any more tips for improvement on the script, that'd be great.


Re: Faster Registration/.ini file creation - Betamaster - 02.05.2010

Perhaps you could look into DJson.