I added few lines in iologindata.cpp to add a variable player->customvar and It worked really well, I was able to retrieve it as planned.
The problem is that I'm not able to browse the result of a query when it is a list.
This is the code I came up with. What I want is to get the position of a result in the sorted list.
It's supposed to check if the player is in the top 5 of experience if yes tempvar = the position if no = 0.
The problem is that I'm not able to browse the result of a query when it is a list.
This is the code I came up with. What I want is to get the position of a result in the sorted list.
It's supposed to check if the player is in the top 5 of experience if yes tempvar = the position if no = 0.
Code:
result->free();
query.str("");
query << "SELECT `id`, `group_id`, `experience`, `level` "
<< "FROM `players` "
<< "WHERE `group_id` < 4 AND `deleted` = 0 "
<< "LIMIT 5 "
<< "ORDER BY `experience` DESC";
if((result = db->storeQuery(query.str()))) // Will it works to store an array of result? (knowing that result is declared this way "DBResult* result;"
{
int tempvar =0;
//get the position in the result array where id = player->getGUID (or another way to retrieve actual player id)
//if not present left the value to 0
}