Guest User

Untitled

a guest
Jul 26th, 2020
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.11 KB | None | 0 0
  1. case DIALOG_STAFF: {
  2. if(!response) return true;
  3. new szQuery[1024], szResult[1024], szDialog[1024], szDialog2[4000], Cache: result;
  4. new szPlayers, szPlayersT;
  5. new szName[180], szAdmin, szLastOn[180], x, y, szTitle[180], warns, userID;
  6. switch(listitem) {
  7. case 0: {
  8. format(szQuery, sizeof(szQuery), "SELECT * FROM `users` WHERE `Admin`>'0' ORDER BY `users`.`Admin` ASC LIMIT 50");
  9. result = mysql_query(SQL, szQuery);
  10. strcat(szDialog2, "Name\tStatus\tRaport\tWarns\n");
  11. for(new i, j = cache_num_rows(); i < j; i++)
  12. {
  13. cache_get_field_content(i, "name", szResult); format(szName, 256, szResult);
  14. cache_get_field_content(i, "Admin", szResult); szAdmin = strval(szResult);
  15. cache_get_field_content(i, "lastOn", szResult); format(szLastOn, 256, "Offline (%s)", szResult);
  16. cache_get_field_content(i, "HelpedPlayers", szResult); szPlayers = strval(szResult);
  17. cache_get_field_content(i, "HelpedPlayersToday", szResult); szPlayersT = strval(szResult);
  18. cache_get_field_content(i, "AW", szResult); warns = strval(szResult);
  19. userID = GetPlayerID( szName );
  20. userID = GetPlayerID( szName );
  21. if(userID != INVALID_PLAYER_ID) format(szLastOn, 256, "Online (%d)", userID);
  22.  
  23. x++;
  24. format(szDialog, sizeof(szDialog), "(%d) %s\t%s\t%d on this week / %d total\t%d/3\n", szAdmin, szName, szLastOn, szPlayersT, szPlayers, warns);
  25. strcat(szDialog2, szDialog);
  26. }
  27. cache_delete(result);
  28. format(szTitle, sizeof(szTitle), "{FFEE00}Admins (%d/%d)", GetStaffOnline(0), x);
  29. }
  30. case 1: {
  31. format(szQuery, sizeof(szQuery), "SELECT * FROM `users` WHERE `Helper`>'0' ORDER BY `users`.`Helper` ASC LIMIT 50");
  32. result = mysql_query(SQL, szQuery);
  33. strcat(szDialog2, "Name\tStatus\tRaport\tWarns\n");
  34. for(new i, j = cache_num_rows(); i < j; i++) {
  35. cache_get_field_content(i, "name", szResult); format(szName, 256, szResult);
  36. cache_get_field_content(i, "Helper", szResult); szAdmin = strval(szResult);
  37. cache_get_field_content(i, "lastOn", szResult); format(szLastOn, 256, "Offline (%s)", szResult);
  38. cache_get_field_content(i, "HelpedPlayers", szResult); szPlayers = strval(szResult);
  39. cache_get_field_content(i, "HelpedPlayersToday", szResult); szPlayersT = strval(szResult);
  40. cache_get_field_content(i, "HW", szResult); warns = strval(szResult);
  41.  
  42. userID = GetPlayerID( szName );
  43. if(userID != INVALID_PLAYER_ID) format(szLastOn, 256, "Online (%d)", userID);
  44. y++;
  45. format(szDialog, sizeof(szDialog), "(%d) %s\t%s\t%d azi / %d total\t%d/3\n", szAdmin, szName, szLastOn, szPlayersT, szPlayers, warns);
  46. strcat(szDialog2, szDialog);
  47. }
  48. cache_delete(result);
  49. format(szTitle, sizeof(szTitle), "{FFEE00}Helperi (%d/%d)", GetStaffOnline(1), y);
  50. }
  51. }
  52. ShowPlayerDialog(playerid, DIALOG_STAFF+1, DIALOG_STYLE_TABLIST_HEADERS, szTitle, szDialog2, "Ok", "Back");
  53. }
  54. case DIALOG_STAFF+1: {
  55. if(!response) return ShowPlayerDialog(playerid, DIALOG_STAFF, DIALOG_STYLE_LIST, "Staff", "Admini\nHelperi", "Ok", "Close");
  56. }
Advertisement
Add Comment
Please, Sign In to add comment