Not saving correctly
#1

So the problem is this doesn't save variables correctly in database, it sets the same strings for everyone in the db, everything is the same for everybody idk what is the problem

pawn Код:
stock UpdateIgraca(playerid)
{
    format(gQuery, sizeof(gQuery), "UPDATE `Igraci` SET `Spol` = '%d', `Godine` = '%d', `Skin` = '%d', `Admin` = '%d', `Banovan` = '%d', `Opomene` = '%d', `Lisice` = '%d', `Lider` = '%d'", PI[playerid][Spol], PI[playerid][Godine], PI[playerid][Skin], PI[playerid][Admin], PI[playerid][Banovan], PI[playerid][Opomene], PI[playerid][Lisice], PI[playerid][Lider]);

    mysql_function_query(konekt, gQuery, true, "OnQueryFinish", "ii", THREAD_OSTALO, playerid);

    format(gQuery, sizeof(gQuery), "%s, `Clan` = '%d', `Rank` = '%d', `TrazeniNivo` = '%d', `Zatvoren` = '%d', `ZatvorenVreme` = '%d', `UhapsenPuta` = '%d', `Utisan` = '%d'", gQuery, PI[playerid][Clan], PI[playerid][Rank], PI[playerid][TrazeniNivo], PI[playerid][Zatvoren], PI[playerid][ZatvorenVreme], PI[playerid][UhapsenPuta], PI[playerid][Utisan], ImeIgraca(playerid));

    mysql_function_query(konekt, gQuery, true, "OnQueryFinish", "ii", THREAD_OSTALO, playerid);

    format(gQuery, sizeof(gQuery), "%s, `Int` = '%d', `Telefon` = '%d', `Imenik` = '%d', `Mobilni` = '%d', `Novac` = '%d', `Posao` = '%d', `PosaoUgovor` = '%d'", gQuery, GetPlayerInterior(playerid), PI[playerid][Telefon], PI[playerid][Imenik], PI[playerid][Mobilni], PI[playerid][Novac], PI[playerid][Posao], PI[playerid][PosaoUgovor]);

    mysql_function_query(konekt, gQuery, true, "OnQueryFinish", "ii", THREAD_OSTALO, playerid);

    format(gQuery, sizeof(gQuery), "%s, `Maska` = '%d', `Droga` = '%d', `Level` = '%d', `Exp` = '%d', `PDPoeni` = '%d', `SatiIgre` = '%d'", gQuery, PI[playerid][Maska], PI[playerid][Droga], PI[playerid][Level], PI[playerid][Exp], PI[playerid][PDPoeni], PI[playerid][SatiIgre]);

    mysql_function_query(konekt, gQuery, true, "OnQueryFinish", "ii", THREAD_OSTALO, playerid);

    format(gQuery, sizeof(gQuery), "%s, `Posao` = '%d', `PosaoUgovor` = '%d', `Kuca`  = '%d', `RentaKucu` = '%d', `Banka` = '%d', `Kredit` = '%d', `IznosRate` = '%d', `PreostaloOdplatiti` = '%d' WHERE `Ime` = '%s'", gQuery, PI[playerid][PosaoUgovor], PI[playerid][Kuca], PI[playerid][RentaKucu], PI[playerid][Banka], PI[playerid][Kredit], PI[playerid][IznosRate], PI[playerid][PreostaloOdplatiti], ImeIgraca(playerid));

    mysql_function_query(konekt, gQuery, true, "OnQueryFinish", "ii", THREAD_OSTALO, playerid);
    return 1;
}
and the function that calls this

pawn Код:
CMD:gmx(playerid, params[])
{
    if(PI[playerid][Admin] < 5) return SCM(playerid, TOMATO, "[RPF] {FFFFFF}Niste ovlasteni za koristenje ove komande.");

    new str[220];
    format(str, sizeof(str), "(( Staff %s je zapoceo restart servera, server ce se restartovati za 5 sekundi. ))", ImeIgraca(playerid));
    SendClientMessageToAll(DBLUE, str);
   
    foreach(Player, i)
    {
        UpdateIgraca(i);
        SetTimer("ServerGMX", 5000, false);
    }
    return 1;
}
Reply


Messages In This Thread
Not saving correctly - by ShoortyFl - 20.06.2015, 23:04
Re: Not saving correctly - by Dusan01 - 20.06.2015, 23:15
Re: Not saving correctly - by ShoortyFl - 20.06.2015, 23:21
Re: Not saving correctly - by Dusan01 - 20.06.2015, 23:30
Re: Not saving correctly - by ShoortyFl - 20.06.2015, 23:32
Re: Not saving correctly - by Dusan01 - 20.06.2015, 23:35
Re: Not saving correctly - by ShoortyFl - 21.06.2015, 12:40
Re: Not saving correctly - by IzadorO - 21.06.2015, 15:09
Re: Not saving correctly - by Stanford - 21.06.2015, 15:57
Re: Not saving correctly - by Konstantinos - 21.06.2015, 16:29

Forum Jump:


Users browsing this thread: 1 Guest(s)