08.01.2015, 06:35
Hello guys, few months ago I wrote a system that it does find me inactive players that they haven't join the server for more than 2 months. (It's not that accurate, but it does it's work)
So, I knew that when 2015 comes out, it should get bugged. So I made a simple check to be sure, but I'm not that sure if it's join to work.
I Know that it could be written with a better way, but I don't really have that time to do it.
Any advice? It will work or it's going to return false results.
So, I knew that when 2015 comes out, it should get bugged. So I made a simple check to be sure, but I'm not that sure if it's join to work.
pawn Код:
format(Query, sizeof(Query), "SELECT `LastLogin` FROM `Users` WHERE `Username` = '%s' LIMIT 0, 1", DB_Escape(hInfo[h][Owner]));
Result = db_query(Database, Query);
if(db_num_rows(Result))
{
db_get_field_assoc(Result, "LastLogin", Date, 32);
if(!sscanf(Date, "p</>ddd", sDay, sMonth, sYear))
{
if(sYear != Year)
{
//sMonth = The last month player joined. Month = the current month.
//So if player joined in the 10 month and now it's 1, (10 - 1) = 9, so 2 months. The same with (11 - 2) = 9, (12 - 3) = 9.
if((sMonth - Month) <= 9)
{
hInfo[h][IsOwnerInactive] = 1;
LoadedInactiveHouses++;
}
}
else if((Month - sMonth) >= 2)
{
hInfo[h][IsOwnerInactive] = 1;
LoadedInactiveHouses++;
}
}
}
db_free_result(Result);
Any advice? It will work or it's going to return false results.