Understanding MySQL -
_Khaled_ - 01.09.2012
Hello,
I've been using INI for my server..
but some people recommend me that I use MySQL..
I installed it, but haven't added anything to my gamemode yet
I need some help in switching from Y_INI Into MySQL,
Any help in Teamviewer?
Re: Understanding MySQL -
_Khaled_ - 01.09.2012
Bump
Re: Understanding MySQL -
Cjgogo - 01.09.2012
It'll be hard converting it from Y_INI to MySQL,yet there are people who have in their signature :"Converting scripts from MySQL into YINI,and viceversa".If you don't want to use player's data online on a site don't convert.
Re: Understanding MySQL -
_Khaled_ - 01.09.2012
I do want, that's why I'm converting..
Do you know anyone converting?
Re: Understanding MySQL -
_Khaled_ - 01.09.2012
BUMP!
Re: Understanding MySQL -
doreto - 01.09.2012
Quote:
Originally Posted by _Khaled_
BUMP!
|
So what you will do now spamm wichout code great thinkin?
Re: Understanding MySQL - Jarnu - 01.09.2012
its a bit hard to understand mysql for beginners..i even tried but failed many times.
Re: Understanding MySQL -
_Khaled_ - 01.09.2012
Quote:
Originally Posted by doreto
So what you will do now spamm wichout code great thinkin?
|
I said teamviewer?
anyways, codes
pawn Код:
#define PATH "/Administration/Users/%s.ini"
enum pInfo
{
pPass,
pCash,
pScore,
pAdminLevel,
pKills,
pDeaths,
pBanned
}
new PlayerInfo[MAX_PLAYERS][pInfo];
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Password",PlayerInfo[playerid][pPass]);
INI_Int("Score",PlayerInfo[playerid][pScore]);
INI_Int("Cash",PlayerInfo[playerid][pCash]);
INI_Int("AdminLevel",PlayerInfo[playerid][pAdminLevel]);
INI_Int("Kills",PlayerInfo[playerid][pKills]);
INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
INI_Int("Banned",PlayerInfo[playerid][pBanned]);
return 1;
}
stock UserPath(playerid)
{
new string[128],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),PATH,playername);
return string;
}
stock udb_hash(buf[]) {
new length=strlen(buf);
new s1 = 1;
new s2 = 0;
new n;
for (n=0; n<length; n++)
{
s1 = (s1 + buf[n]) % 65521;
s2 = (s2 + s1) % 65521;
}
return (s2 << 16) + s1;
}
Re: Understanding MySQL -
CoDeZ - 01.09.2012
Bro , i wanted to do the same
Everything went good but i have this problem now
i could convert all userdata into a .sql file and import it into a database and it worked
but problem was , there is no Name field into the .ini file
Also , hashing the passwords was second problem because i wanted to hash all passwords using whirlpool.
you might say why not adding name field manually?
i'd tell you because your server might have 30k files now , so its gonna take to time to add names into all these fields anyways good luck.
Re: Understanding MySQL -
_Khaled_ - 01.09.2012
My server is still in beta and only has one player which is me, Do you mind switching it for me? :\