Jump to content
  • 0

pomoc Mysql - load,save


RealGaming

Dotaz

Ahoj chci se zeptat, jestli v tomhle kodu je potřeba volat cache_delete() - dole.. ?

```//PlayerData
stock LoadDataPlayer(playerid)
{
    new query[358];
    mysql_format(DB_realgaming, query, sizeof(query), "SELECT * FROM PlayerData WHERE `NickName` = '%s'", PlayerName(playerid));
    mysql_query(DB_realgaming, query);
    if(cache_num_rows() > 0)
    {
        //Informace o hráči ve hře
        cache_get_value_name(0, "Email", SaveData[playerid][EmailSave],64);
        cache_get_value_int(0, "Zabit", SaveData[playerid][ZabitHrac]);
        cache_get_value_int(0, "Zabil", SaveData[playerid][ZabilHrace]);
        cache_get_value_int(0, "Penize", SaveData[playerid][MoneySave]);
        cache_get_value_int(0, "Banka", SaveData[playerid][BankaSave]);
        cache_get_value_int(0, "Skin", SaveData[playerid][Skin]);
        cache_get_value_int(0, "AdminLevel", SaveData[playerid][AdminLevel]);
        cache_get_value_int(0, "VIP", SaveData[playerid][VIPHrac]);
        cache_get_value_int(0, "XP", SaveData[playerid][XPHrac]);
        cache_get_value_int(0, "Zamestnani", SaveData[playerid][Zamestnani]);
        cache_get_value_int(0, "Odehrano", SaveData[playerid][CelkemOdehrano]);
        cache_get_value_int(0, "Vezeni", SaveData[playerid][VezeniCas]);
        cache_get_value_int(0, "WL", SaveData[playerid][WantedLevel]);
    }
    return 1;
}```
Díky.

Link to comment
Share on other sites

3 odpovědí na tuto otázku

Recommended Posts

  • 0
  • Globální moderátor

Ano, pokud to neni INSERT nebo UPDATE, je potreba cistka cache.

 

stock LoadDataPlayer(playerid)
{
    new query[358];
    mysql_format(DB_realgaming, query, sizeof(query), "SELECT * FROM PlayerData WHERE `NickName` = '%s'", PlayerName(playerid));
    mysql_query(DB_realgaming, query);

    if (cache_num_rows() > 0)
    {
        // Informace o hráči ve hře
        cache_get_value_name(0, "Email", SaveData[playerid][EmailSave], 64);
        cache_get_value_int(0, "Zabit", SaveData[playerid][ZabitHrac]);
        cache_get_value_int(0, "Zabil", SaveData[playerid][ZabilHrace]);
        cache_get_value_int(0, "Penize", SaveData[playerid][MoneySave]);
        cache_get_value_int(0, "Banka", SaveData[playerid][BankaSave]);
        cache_get_value_int(0, "Skin", SaveData[playerid][Skin]);
        cache_get_value_int(0, "AdminLevel", SaveData[playerid][AdminLevel]);
        cache_get_value_int(0, "VIP", SaveData[playerid][VIPHrac]);
        cache_get_value_int(0, "XP", SaveData[playerid][XPHrac]);
        cache_get_value_int(0, "Zamestnani", SaveData[playerid][Zamestnani]);
        cache_get_value_int(0, "Odehrano", SaveData[playerid][CelkemOdehrano]);
        cache_get_value_int(0, "Vezeni", SaveData[playerid][VezeniCas]);
        cache_get_value_int(0, "WL", SaveData[playerid][WantedLevel]);
    }

    cache_delete();
    return 1;
}

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...