Dini is too slow to save data under OnPlayerDisconnect?
#1

When the player uses /savestats cmd, his stats save successfully in-game.

pawn Код:
CMD:savestats(playerid, params[])
{
    SendClientMessage(playerid, COLOR_YELLOW, ".:||Stats Saved||:.");
    dini_Set(file, "example0", PlayerInfo[playerid][example0]);
    dini_Set(file, "example1", PlayerInfo[playerid][example1]);
    dini_Set(file, "example2", PlayerInfo[playerid][example2]);
    dini_Set(file, "example3", PlayerInfo[playerid][example3]);
    return 1;
}
But when i put the same thing under OnPlayerDisconnect ( and add if(gPlayerLogged == 1) ) the stats won't save

Under onplayerdisconnect

pawn Код:
format(file, sizeof(file), SERVER_USER_FILE, GetName(playerid));
if(gPlayerLogged[playerid] == 1)
    {
        dini_Set(file, "example0", PlayerInfo[playerid][example0]);
        dini_Set(file, "example1", PlayerInfo[playerid][example1]);
        dini_Set(file, "example2", PlayerInfo[playerid][example2]);
        dini_Set(file, "example3", PlayerInfo[playerid][example3]);
    }
    gPlayerLogged[playerid] = 0;
Any solution?
Reply
#2

Use YSI [y_ini] it saves data very fastly, and DINI's kinda old. So, i'll advise you to switch it from y_ini
Reply
#3

y_ini is the best at the moment Try it, it's much much more faster than Dini
Reply
#4

Thanks guys, ill switch right now
Reply
#5

That's the right thing to do If you need any further help just PM me
Reply
#6

Well... actually... Y_ini is the fastest individual saver. However if you want really quick speed I'd roll with MySQL, it'd take some time to convert, but the speed will amaze you at times.
Reply
#7

Quote:
Originally Posted by ******
Посмотреть сообщение
I have to point out, yet again, that SQL is NOT a magic bullet. Yes, you CAN get good speed from it, but most people don't realise that it is actually a whole other language, not just 3 functions you call that transforms your mode instantly. If you want the possible speed you have to put in the effort to learn the language for what it is - another language.
I know it's not a "magic bullet". But if you have a gamemode with a lot of registered players (or vehicles, homes or businesses) it can definitely speed up the process of things. And MySQL is used in multiple programming languages so it never really hurts to learn it regardless.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)