Whomenu

Discutii legate de instalarea, configurarea si modificarea unui server de Counter-Strike.

Moderators: Moderatori ajutatori, Moderatori

Post Reply
Mariusz.#
Membru, skill +1
Membru, skill +1
Posts: 247
Joined: 20 Jul 2013, 21:49
Detinator Steam: Da
CS Status: Citesc
Detinator server CS: DRX.Evils.Ro[700GR]
SteamID: Zapp38
Location: Nicaieri
Has thanked: 29 times
Contact:

05 Jul 2014, 17:15

Am o problema, am compilat whomenu a lui askhanar, il bag pe server, dau who si nu merge, nu face nimica ..

uitati sursa
| Afiseaza codul
#include <amxmodx>

#pragma semicolon 1


#define MAX_GROUPS 6

new const g_groupNames[ MAX_GROUPS ][ ] = {
   
	"Owner",
	"God",
	"Moderator",
	"Administrator",
	"Helper",
	"Slot VZG"
};

new const g_groupFlags[ MAX_GROUPS ][ ] = {
	
	"abcdefghijklmpqrstu",
	"abcdefghijklmpqrs",
	"bcdefghijmpqr",  
	"bcdefijmp",
	"bcdefi",
	"b"
};

new const g_groupFlagsVIP[ MAX_GROUPS ][ ] = {
	
	"abcdefghijklmpqrstuno",
	"abcdefghijklmpqrsno",
	"bcdefghijmpqrno",  
	"bcdefijmpno",
	"bcdefino",
	"bno"
};


#define PLUGIN	"Ultimate Who"
#define VERSION	"2.0"

static const MENU_NAME[ ] = "\r| \wNume Admin \r| \wGrad \r| \wSlot \r|\w VIP \r|";
static const NO_ADMINS_MENU_NAME[ ] = "\y--> [ Nu sunt admini online ] <--";
static const MENU_EXIT_NAME[ ] = "\y--> [ Iesire ] <--";

public plugin_init( )
{
	
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	
	register_clcmd( "say /who", "cmdWho", ADMIN_USER );
	register_clcmd( "say /admins", "cmdWho", ADMIN_USER );
	register_concmd( "say /admin", "cmdWho", ADMIN_USER );
	register_clcmd( "say_team /who", "cmdWho", ADMIN_USER );
	register_clcmd( "say_team /admins", "cmdWho", ADMIN_USER );
	register_concmd( "say_team /admin", "cmdWho", ADMIN_USER );
	
}

public cmdWho( id )
{
	ShowMenu( id, 0 );
	return 1;
}

public ShowMenu(id, page)
{
	new MenuName[ 64 ], MenuExitKey[ 32 ];
	
	formatex( MenuName, sizeof ( MenuName ) -1, "%s",  MENU_NAME );

	formatex( MenuExitKey, sizeof ( MenuExitKey ) -1, "%s", MENU_EXIT_NAME );
	
	new menu = menu_create(MenuName, "MenuHandler");   
	
	if( AdminsOnline(  )  )
	{
		
		for( new i = 0; i < MAX_GROUPS; i++  )
		{
			AddAdminsToMenu( id, menu, i );
		}
	}
	else
	{
		menu_additem( menu, NO_ADMINS_MENU_NAME, "1", 0 );
	}
	
	menu_setprop(menu, MPROP_EXITNAME, MenuExitKey );
	
	menu_display(id, menu, page);
}

public MenuHandler(id, menu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy( menu );
		return 1;
	}
	
	new data[6], iName[64];
	new iaccess, callback;
	
	menu_item_getinfo(menu, item, iaccess, data,5, iName, 63, callback);
	
	new key = str_to_num(data);
	
	switch(key)
	{
		case 1,2,3,4,5,6,7:
		{
			menu_destroy( menu );
			return 1;
		}
	}
	
	return 0;
}

public AddAdminsToMenu( const id, const iMenu,  const iGroup  )
{
	
	new szMenuMessage[ 64 ], szMenuKey[ 32 ], iMenuKey = 1;
	
	new iPlayers[ 32 ];
	new iPlayersNum, iPlayer;
	
	get_players( iPlayers, iPlayersNum, "c" );		
	for( new i = 0 ; i < iPlayersNum ; i++ )
	{
		iPlayer = iPlayers[ i ];
		if( UserHasGroupAcces( iPlayer, iGroup ) )
		{

			formatex( szMenuMessage, sizeof (szMenuMessage ) -1, "\w%s \y-| \w%s \y| %s \y| %s\y | %s",
				get_name( iPlayer ), g_groupNames[ iGroup ],
                                     IsUserVip( iPlayer )? "\rx" : "\dx",
				iPlayers[ i ] == id ? "\r *" : "" );
				
			formatex( szMenuKey, sizeof ( szMenuKey ) -1, "%i", iMenuKey );
			
			menu_additem( iMenu, szMenuMessage, szMenuKey, 0 );
			iMenuKey++;
		}
	}
	
}
	
stock bool:AdminsOnline(    )
{
	new bool:AdminsFound = false;
	
	new iPlayers[ 32 ];
	new iPlayersNum;

	get_players( iPlayers, iPlayersNum, "c" );		
	for( new i = 0 ; i < iPlayersNum ; i++ )
	{

		if( UserHasAnyAcces( iPlayers[ i ] ) >= 0 )
		{
			AdminsFound = true;
			break;
		}
	}
	
	return AdminsFound;
}

stock bool:IsUserVip(  id  )
{
	
	if( get_user_flags(  id  )  &  read_flags(  "on"  )  )
		return true;
	
	return false;
	
}

stock bool:UserHasGroupAcces( id, const iGroup )
{
	static iFlags;
	iFlags = get_user_flags( id );
	
	if( iFlags == read_flags( g_groupFlags[ iGroup ] )
		|| iFlags == read_flags( g_groupFlagsVIP[ iGroup ] ) )
		return true;
		
	return false;
	
}
		
stock UserHasAnyAcces( id )
{
	new iFlags = get_user_flags( id );
	new iValueToReturn = -2;
	
	for( new i = 0; i < MAX_GROUPS; i++ )
	{
		if( iFlags == read_flags( g_groupFlags[ i ] )
			|| iFlags == read_flags( g_groupFlagsVIP[ i ] ) )
		{
			iValueToReturn = i;
			break;
		}
	}
	
	return iValueToReturn;
}

stock get_name( id )
{
	
	new name[ 32 ];
	get_user_name( id, name, sizeof ( name ) -1 );

	return name;
}
IG-BOOST.org - Instagram Followers Best, Cheap, Reliable
User avatar
|NGU|Anonymus
Membru, skill +1
Membru, skill +1
Posts: 308
Joined: 26 May 2014, 14:26
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: In progres...
Has thanked: 16 times
Been thanked: 36 times

05 Jul 2014, 18:12

Incearca si cu alte comenzi: /admin,/admins si inca ceva in users.ini ai aceleasi nr de grade si aceleasi grade de acces ca si in pluginul asta nu??
Mariusz.#
Membru, skill +1
Membru, skill +1
Posts: 247
Joined: 20 Jul 2013, 21:49
Detinator Steam: Da
CS Status: Citesc
Detinator server CS: DRX.Evils.Ro[700GR]
SteamID: Zapp38
Location: Nicaieri
Has thanked: 29 times
Contact:

05 Jul 2014, 18:13

Sorry for 2xpost, bug .. :|
Last edited by Mariusz.# on 05 Jul 2014, 19:02, edited 1 time in total.
Mariusz.#
Membru, skill +1
Membru, skill +1
Posts: 247
Joined: 20 Jul 2013, 21:49
Detinator Steam: Da
CS Status: Citesc
Detinator server CS: DRX.Evils.Ro[700GR]
SteamID: Zapp38
Location: Nicaieri
Has thanked: 29 times
Contact:

05 Jul 2014, 18:13

In users nu am nimica inca, trebuie sa am aceleasi grade + flaguri ca in plugin ?
Edit, am bagat tot in users.ini, dar degeaba ..
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2155
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 33 times
Been thanked: 349 times
Contact:

06 Jul 2014, 22:32

| Afiseaza codul
#include <amxmodx>

#pragma semicolon 1


#define MAX_GROUPS 6

new const g_groupNames[ MAX_GROUPS ][ ] = {
   
	"Owner",
	"God",
	"Moderator",
	"Administrator",
	"Helper",
	"Slot VZG"
};

new const g_groupFlags[ MAX_GROUPS ][ ] = {
	
	"abcdefghijklmpqrstu",
	"abcdefghijklmpqrs",
	"bcdefghijmpqr",  
	"bcdefijmp",
	"bcdefi",
	"b"
};

new const g_groupFlagsVIP[ MAX_GROUPS ][ ] = {
	
	"abcdefghijklmpqrstuno",
	"abcdefghijklmpqrsno",
	"bcdefghijmpqrno",  
	"bcdefijmpno",
	"bcdefino",
	"bno"
};


#define PLUGIN	"Ultimate Who"
#define VERSION	"2.0"

static const MENU_NAME[ ] = "\r| \wNume Admin \r| \wGrad \r| \wSlot \r|\w VIP \r|";
static const NO_ADMINS_MENU_NAME[ ] = "\y--> [ Nu sunt admini online ] <--";
static const MENU_EXIT_NAME[ ] = "\y--> [ Iesire ] <--";

public plugin_init( )
{
	
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	
	register_clcmd( "say /who", "cmdWho" );
	register_clcmd( "say /admins", "cmdWho" );
	register_clcmd( "say_team /who", "cmdWho" );
	register_clcmd( "say_team /admins", "cmdWho" );
	
}

public cmdWho( id )
{
	ShowMenu( id, 0 );
	return 1;
}

public ShowMenu(id, page)
{
	new MenuName[ 64 ], MenuExitKey[ 32 ];
	
	formatex( MenuName, sizeof ( MenuName ) -1, "%s",  MENU_NAME );

	formatex( MenuExitKey, sizeof ( MenuExitKey ) -1, "%s", MENU_EXIT_NAME );
	
	new menu = menu_create(MenuName, "MenuHandler");   
	
	if( AdminsOnline(  )  )
	{
		
		for( new i = 0; i < MAX_GROUPS; i++  )
		{
			AddAdminsToMenu( id, menu, i );
		}
	}
	else
	{
		menu_additem( menu, NO_ADMINS_MENU_NAME, "1", 0 );
	}
	
	menu_setprop(menu, MPROP_EXITNAME, MenuExitKey );
	
	menu_display(id, menu, page);
}

public MenuHandler(id, menu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy( menu );
		return 1;
	}
	
	new data[6], iName[64];
	new iaccess, callback;
	
	menu_item_getinfo(menu, item, iaccess, data,5, iName, 63, callback);
	
	new key = str_to_num(data);
	
	switch(key)
	{
		case 1,2,3,4,5,6,7:
		{
			menu_destroy( menu );
			return 1;
		}
	}
	
	return 0;
}

public AddAdminsToMenu( const id, const iMenu,  const iGroup  )
{
	
	new szMenuMessage[ 64 ], szMenuKey[ 32 ], iMenuKey = 1;
	
	new iPlayers[ 32 ];
	new iPlayersNum, iPlayer;
	
	get_players( iPlayers, iPlayersNum, "c" );		
	for( new i = 0 ; i < iPlayersNum ; i++ )
	{
		iPlayer = iPlayers[ i ];
		if( UserHasGroupAcces( iPlayer, iGroup ) )
		{

			formatex( szMenuMessage, sizeof (szMenuMessage ) -1, "\w%s \y-| \w%s \y| %s \y| %s\y | %s",
				get_name( iPlayer ), g_groupNames[ iGroup ],
                                     IsUserVip( iPlayer )? "\rx" : "\dx",
				iPlayers[ i ] == id ? "\r *" : "" );
				
			formatex( szMenuKey, sizeof ( szMenuKey ) -1, "%i", iMenuKey );
			
			menu_additem( iMenu, szMenuMessage, szMenuKey, 0 );
			iMenuKey++;
		}
	}
	
}
	
stock bool:AdminsOnline(    )
{
	new bool:AdminsFound = false;
	
	new iPlayers[ 32 ];
	new iPlayersNum;

	get_players( iPlayers, iPlayersNum, "c" );		
	for( new i = 0 ; i < iPlayersNum ; i++ )
	{

		if( UserHasAnyAcces( iPlayers[ i ] ) >= 0 )
		{
			AdminsFound = true;
			break;
		}
	}
	
	return AdminsFound;
}

stock bool:IsUserVip(  id  )
{
	
	if( get_user_flags(  id  )  &  read_flags(  "on"  )  )
		return true;
	
	return false;
	
}

stock bool:UserHasGroupAcces( id, const iGroup )
{
	static iFlags;
	iFlags = get_user_flags( id );
	
	if( iFlags == read_flags( g_groupFlags[ iGroup ] )
		|| iFlags == read_flags( g_groupFlagsVIP[ iGroup ] ) )
		return true;
		
	return false;
	
}
		
stock UserHasAnyAcces( id )
{
	new iFlags = get_user_flags( id );
	new iValueToReturn = -2;
	
	for( new i = 0; i < MAX_GROUPS; i++ )
	{
		if( iFlags == read_flags( g_groupFlags[ i ] )
			|| iFlags == read_flags( g_groupFlagsVIP[ i ] ) )
		{
			iValueToReturn = i;
			break;
		}
	}
	
	return iValueToReturn;
}

stock get_name( id )
{
	
	new name[ 32 ];
	get_user_name( id, name, sizeof ( name ) -1 );

	return name;
}
Nu fac nimic contra cost! Faceți cerere bine detaliată aici, pe forum. Nu-mi mai dați add pe Steam doar pentru a mă avea în lista de prieteni.
Am cont și activez doar aici! Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz.
* Inactiv momentan.
M3taph0riK
Membru eXtream
Membru eXtream
Posts: 2133
Joined: 16 Jan 2013, 12:55
Detinator Steam: Da
CS Status: Utilizator Serios
SteamID: Utilizator Serios
Reputatie: Restrictie moderator
Nume anterior: RzV24
Utilizator neserios (tepar)
Has thanked: 60 times
Been thanked: 250 times

07 Jul 2014, 19:08

Mariusz.# wrote:In users nu am nimica inca, trebuie sa am aceleasi grade + flaguri ca in plugin ?
Edit, am bagat tot in users.ini, dar degeaba ..

Normal ! Trebuie sa fie aceleasi grade/accese
Post Reply

Return to “Probleme la servere dedicate de Counter-Strike”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 13 guests