Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void LoadConnects()
- {
- int time = GetTickCount();
- if(!cache_num_rows()) return true;
- for(int idx = 0, ids = 1; idx < cache_num_rows(); ++idx, ++ids)
- {
- cache_get_value_index_int(idx, 0, ConnectsInfo[ids][pID]);
- cache_get_value_index_int(idx, 1, ConnectsInfo[ids][pName]);
- cache_get_value_index_int(idx, 2, ConnectsInfo[ids][pIP]);
- cache_get_value_index_int(idx, 3, ConnectsInfo[ids][pDate]);
- cache_get_value_index_int(idx, 4, ConnectsInfo[ids][pTime]);
- TOTALCONNECTS++;
- }
- printf("[Load connects]: loading %i/%i ms", TOTALCONNECTS, GetTickCount() - time);
- return true;
- }
- CMD:info(playerid, params[])
- {
- new ip, Date, time;
- new Cache:result = mysql_query(MySQL, "select `ID` from `connections`");
- if(!cache_num_rows()) return SendClientMessage(playerid, -1, "Нет последних входов!");
- int str[64], strr[1024];
- format(str, sizeof(str), ""WHITE"Дата\t\t"WHITE"Время\t\t"WHITE"IP\n");
- strcat(strr, str);
- for(int i = 0; i < cache_num_rows(); i++)
- {
- cache_get_value_index_int(i, 2, ip);
- cache_get_value_index_int(i, 3, Date);
- cache_get_value_index_int(i, 4, time);
- format(str, sizeof(str), ""WHITE"%s\t\t%d\t\t%i\n", date("%dd.%mm.%yyyy", Date), time, ip);
- strcat(strr, str);
- }
- cache_delete(result);
- ShowPlayerDialog(playerid, D_NULL, DIALOG_STYLE_TABLIST_HEADERS, "Последние входы в игру", strr, "Мне пора", "");
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement