Jump to content
×
×
  • Create New...

Admins Online in meniu (cu grade) 1.1.0

   (0 reviews)

1 Screenshot

About This File

Nume: Admins Online
Versiune: 1.1
Autor: tre3fla

Plugins: 

#include <sourcemod>

Handle: Style

public Plugin:myinfo = {
	name = "Admins Online",
	author = "tre3fla",
	description = "Arata adminii online",
	version = "1.1",
	url = "gamelife.ro"
}

public OnPluginStart( ) {
	Style = CreateConVar( "sm_adminmenu_style", "0", "0=adminii pot fi selectati si meniul dispare, 1=adminii nu pot fi selectati" )
	
	RegConsoleCmd( "admins", Command_ShowAdminsOnline )
}

public Action: Command_ShowAdminsOnline( client, args ) {
	new Handle:AdminsOnline = CreateMenu( AdminsOnline_Handler )
	SetMenuTitle( AdminsOnline, "Admin Name | Admin Group" )
	
	int Admins = 0
	
	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 ) ) {
						Admins++
						
						decl String: AdminNameAndGroup[ 64 ]
						Format( AdminNameAndGroup, sizeof( AdminNameAndGroup ), "%N | %s", index, GroupBuffer )
						
						switch( GetConVarInt( Style ) ) {
							case 0: {
								AddMenuItem( AdminsOnline, "selected", AdminNameAndGroup )
							}
							case 1: {
								AddMenuItem( AdminsOnline, "selected", AdminNameAndGroup, ITEMDRAW_DISABLED )
							}
						}
					}
				}
			}
		}
	}
	
	if( Admins <= 0 ) {
		PrintToChat( client, "*\x02 Nu este nici un admin connectat!" )
	}
	else {
		PrintToChat( client, "*\x05 In acest moment sunt\x04 %d\x05 admini online!", Admins )
	}
	
	SetMenuExitButton( AdminsOnline, true )
	DisplayMenu( AdminsOnline, client, 30 )
}

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 )
			}
		}
	}
}



Descriere:
Cu ajutorul acestui plugin jucatorii pot vedea ce admini sunt online si ce grade au acestia daca scriu o comanda in chat.

ConVar-uri (se adauga in autoexec.cfg)

Quote

 

sm_adminmenu_style

0 = adminii din meniu vor putea fi selectati iar cand acest lucru se intampla meniul dispare, ca si cum ai da exit

1 = adminii nu pot fi selectati iar meniul trebuie inchis din buton de exit

 

Comenzi:

Quote

!admins - arata un meniu cu adminii online si gradele acestora

Cerinte:
- Va trebui sa dati adminele pe baza de grupuri, aveti aici un tutorial cum puteti face asta: tutoriale-csgo/cum-dai-admin-baza-grupuri-t344208.html

Instalare:
1. Fisierul AdminsOnline.sp il puneti in addons/sourcemod/scripting
2. Fisierul AdminsOnline.smx il puneti in addons/sourcemod/plugins

 

 

 Share


User Feedback

You may only provide a review once you have downloaded the file.

There are no reviews to display.