Advertisement
Sem_Loreann

Untitled

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