Good / Bad - Your opinion - 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: Good / Bad - Your opinion (
/showthread.php?tid=208439)
Good / Bad - Your opinion -
GiS - 08.01.2011
Hey,
I asked myself if it's a good scriptingstyle to save the direction of the Userfile in an enum. So you don't have to wrte these lines everytime.
Without enum you have to write the following everytime:
PHP код:
new pname[24], file[36];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "Users/%s.ini", pname);
dini_Set(file, "test", "test");
With enum only this:
PHP код:
dini_Set(PlayerInfo[playerid][file], "test", "test");
What's your opinion regarding this?
Re: Good / Bad - Your opinion -
Mr.Stranger - 08.01.2011
it's better to write in enum
Re: Good / Bad - Your opinion -
DVDK - 08.01.2011
Quote:
Originally Posted by Mr.Stranger
it's better to write in enum
|
Indeed, and it's even better to do it all with MySQL.
Re: Good / Bad - Your opinion -
Joe Staff - 08.01.2011
It's better to not use dini also
MySQL is far slower and leaves possible security risks
Re: Good / Bad - Your opinion -
GiS - 08.01.2011
Quote:
Originally Posted by DVDK
Indeed, and it's even better to do it all with MySQL.
|
Why is it better with MySQL?
Re: Good / Bad - Your opinion -
JaTochNietDan - 08.01.2011
If you're going to use a file saving system, I recommend using y_ini, it's faster and much better than dini.
Re: Good / Bad - Your opinion -
Mr.Stranger - 08.01.2011
because it's the fastest and most neat way