Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- public Plugin:myinfo = {
- name = "Admins Online",
- author = "tre3fla",
- description = "Arata adminii online",
- version = "1.0",
- url = "http://"
- }
- public OnPluginStart( ) {
- RegConsoleCmd( "admins", Command_ShowAdminsOnline )
- }
- public Action: Command_ShowAdminsOnline( client, args ) {
- new Handle:AdminsOnline = CreateMenu( AdminsOnline_Handler )
- SetMenuTitle( AdminsOnline, "Admin Name | Admin Group" )
- for( new index = 1; index < MaxClients; index++ ) {
- if( IsClientInGame( index ) ) {
- new AdminId: ClientAccess = GetUserAdmin( index )
- if( ClientAccess ) {
- new AdminGroupsCount = GetAdminGroupCount( ClientAccess )
- for( new x = 0; x < AdminGroupsCount; x++ ) {
- decl String:GroupBuffer[ 32 ]
- if( ( GetAdminGroup( ClientAccess, x, GroupBuffer, sizeof( GroupBuffer ) ) != INVALID_GROUP_ID ) ) {
- decl String: AdminNameAndGroup[ 64 ]
- Format( AdminNameAndGroup, sizeof( AdminNameAndGroup ), "%N | %s", index, GroupBuffer )
- AddMenuItem( AdminsOnline, "selected", AdminNameAndGroup, ITEMDRAW_DISABLED )
- }
- }
- }
- }
- }
- SetMenuExitButton( AdminsOnline, true )
- DisplayMenu( AdminsOnline, client, 60 )
- }
- public AdminsOnline_Handler( Handle:AdminsOnline, MenuAction:action, pos, neg ) {
- switch( action ) {
- case MenuAction_Select: {
- decl String: Info[ 32 ]
- GetMenuItem( AdminsOnline, neg, Info, sizeof( Info ) )
- if( StrEqual( Info, "selected" ) ) {
- if( AdminsOnline != INVALID_HANDLE ) {
- CancelMenu( AdminsOnline )
- }
- }
- }
- case MenuAction_End: {
- if( AdminsOnline != INVALID_HANDLE ) {
- CancelMenu( AdminsOnline )
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement