Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- comanda:
- YCMD:staff(playerid, params[], help) {
- if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, COLOR_LIGHTGREEN3, AdminOnly);
- ShowPlayerDialog(playerid, DIALOG_STAFF, DIALOG_STYLE_LIST, "Staff", "Admins\nHelpers", "Ok", "Close");
- return 1;
- }
- pui la ondialogresponse:
- if(dialogid == DIALOG_STAFF) {
- if(!response) return 1;
- new szQuery[1024], szResult[1024], szDialog[1024], szDialog2[4000], Cache: result;
- new szName[180], szAdmin, szLastOn[180], x, y, szTitle[180], userID;
- switch(listitem) {
- case 0:
- {
- format(szQuery, sizeof(szQuery), "SELECT * FROM `users` WHERE `Admin`>'0' ORDER BY `users`.`Admin` ASC LIMIT 50");
- result = mysql_query(SQL, szQuery);
- strcat(szDialog2, "Name\tStatus\n");
- for(new i, j = cache_get_row_count (); i < j; i++)
- {
- cache_get_field_content(i, "name", szResult); format(szName, 256, szResult);
- cache_get_field_content(i, "Admin", szResult); szAdmin = strval(szResult);
- cache_get_field_content(i, "lastOn", szResult); format(szLastOn, 256, "Offline (%s)", szResult);
- userID = GetPlayerID( szName );
- if(userID != INVALID_PLAYER_ID) format(szLastOn, 256, "Online (%d)", userID);
- x++;
- format(szDialog, sizeof(szDialog), "(%d) %s\t%s\n", szAdmin, szName, szLastOn);
- strcat(szDialog2, szDialog);
- }
- cache_delete(result);
- format(szTitle, sizeof(szTitle), "Admins (%d/%d)", GetStaffOnline(0), x);
- }
- case 1:
- {
- format(szQuery, sizeof(szQuery), "SELECT * FROM `users` WHERE `Helper`>'0' ORDER BY `users`.`Helper` ASC LIMIT 50");
- result = mysql_query(SQL, szQuery);
- strcat(szDialog2, "Name\tStatus\n");
- for(new i, j = cache_get_row_count (); i < j; i++)
- {
- cache_get_field_content(i, "name", szResult); format(szName, 256, szResult);
- cache_get_field_content(i, "Helper", szResult); szAdmin = strval(szResult);
- cache_get_field_content(i, "lastOn", szResult); format(szLastOn, 256, "Offline (%s)", szResult);
- userID = GetPlayerID( szName );
- if(userID != INVALID_PLAYER_ID) format(szLastOn, 256, "Online (%d)", userID);
- y++;
- format(szDialog, sizeof(szDialog), "(%d) %s\t%s\n", szAdmin, szName, szLastOn);
- strcat(szDialog2, szDialog);
- }
- cache_delete(result);
- format(szTitle, sizeof(szTitle), "Helpers (%d/%d)", GetStaffOnline(1), y);
- }
- }
- ShowPlayerDialog(playerid, DIALOG_STAFF2, DIALOG_STYLE_TABLIST_HEADERS, szTitle, szDialog2, "Ok", "Back");
- }
- if(dialogid == DIALOG_STAFF2) {
- if(!response) return ShowPlayerDialog(playerid, DIALOG_STAFF, DIALOG_STYLE_LIST, "Staff", "Admins\nHelpers", "Ok", "Close");
- }
- #define DIALOG_STAFF 6969
- #define DIALOG_STAFF2 6970
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement