Understanding MySQL
#1

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?
Reply
#2

Bump
Reply
#3

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.
Reply
#4

I do want, that's why I'm converting..
Do you know anyone converting?
Reply
#5

BUMP!
Reply
#6

Quote:
Originally Posted by _Khaled_
Посмотреть сообщение
BUMP!
So what you will do now spamm wichout code great thinkin?
Reply
#7

its a bit hard to understand mysql for beginners..i even tried but failed many times.
Reply
#8

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;
}
Reply
#9

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.
Reply
#10

My server is still in beta and only has one player which is me, Do you mind switching it for me? :\
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)