Advertisement
Sem_Loreann

Untitled

Apr 23rd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. void LoadConnects()
  2. {
  3. int time = GetTickCount();
  4. if(!cache_num_rows()) return true;
  5. for(int idx = 0, ids = 1; idx < cache_num_rows(); ++idx, ++ids)
  6. {
  7. cache_get_value_index_int(idx, 0, ConnectsInfo[ids][pID]);
  8. cache_get_value_index_int(idx, 1, ConnectsInfo[ids][pName]);
  9. cache_get_value_index_int(idx, 2, ConnectsInfo[ids][pIP]);
  10. cache_get_value_index_int(idx, 3, ConnectsInfo[ids][pDate]);
  11. cache_get_value_index_int(idx, 4, ConnectsInfo[ids][pTime]);
  12. TOTALCONNECTS++;
  13. }
  14. printf("[Load connects]: loading %i/%i ms", TOTALCONNECTS, GetTickCount() - time);
  15. return true;
  16. }
  17.  
  18. CMD:info(playerid, params[])
  19. {
  20. new ip, Date, time;
  21. new Cache:result = mysql_query(MySQL, "select `ID` from `connections`");
  22. if(!cache_num_rows()) return SendClientMessage(playerid, -1, "Нет последних входов!");
  23. int str[64], strr[1024];
  24. format(str, sizeof(str), ""WHITE"Дата\t\t"WHITE"Время\t\t"WHITE"IP\n");
  25. strcat(strr, str);
  26. for(int i = 0; i < cache_num_rows(); i++)
  27. {
  28. cache_get_value_index_int(i, 2, ip);
  29. cache_get_value_index_int(i, 3, Date);
  30. cache_get_value_index_int(i, 4, time);
  31. format(str, sizeof(str), ""WHITE"%s\t\t%d\t\t%i\n", date("%dd.%mm.%yyyy", Date), time, ip);
  32. strcat(strr, str);
  33. }
  34. cache_delete(result);
  35. ShowPlayerDialog(playerid, D_NULL, DIALOG_STYLE_TABLIST_HEADERS, "Последние входы в игру", strr, "Мне пора", "");
  36. return true;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement