Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <amxmisc>
- #define PLUGIN "Who meniu"
- #define VERSION "1.0"
- #define AUTHOR "Askwrite" // Modificat de SnowFake
- #define GRUPURI 15
- new const TITLU[] = " \y Admini\y[\wNUMESERVER.RO\y]";
- new const IESIRE[] = "\yIesire, Apasa \r0 sau \r5^n";
- new const NOADMINS[] = "\y Nu sunt admini online.";
- #pragma semicolon 1
- new g_NumeGrade[ GRUPURI ][ ] = {
- "\y[\yManager\y] + \rVIP",
- "\y[\yOWNER\y] |\rVIP",
- "\y[\yOWNER\y]",
- "\y[\yAdministrator\y] + \rVIP",
- "\y[\yAdministrator\y]",
- "\y[\yG.MOD\y] + \rVIP",
- "\y[\yG.MOD\y]",
- "\y[\yModerator\y] + \rVIP",
- "\y[\yModerator\y]",
- "\y[\yAdmins\y] + \rVIP",
- "\y[\yAdmins\y]",
- "\y[\yHelper\y] + \rVIP",
- "\y[\yHelper\y]",
- "\y[\yVizitator\y] + \rVIP",
- "\y[\yVizitator\y]"
- };
- new g_Flaguri[ GRUPURI ][ ] = {
- "abcdefghijklmnopqrstu",
- "bcdefghijklmnopqrstu",
- "bcdefghijklmnopqrsu",
- "bcdefghijklmnotu",
- "bcdefghijklmno",
- "bcdefgijklmt",
- "bcdefgijklm",
- "bcdefijt",
- "bcdefij",
- "bceft",
- "bcef",
- "bct",
- "bc",
- "bt",
- "b"
- };
- new g_ValueFlaguri[ GRUPURI ];
- public plugin_init( ) {
- register_plugin( PLUGIN, VERSION, AUTHOR );
- for( new i = 0 ; i < GRUPURI ; i++ )
- g_ValueFlaguri[ i ] = read_flags( g_Flaguri[ i ] );
- register_clcmd("say /who", "cmdWho");
- register_clcmd("say_team /who", "cmdWho");
- register_clcmd("say /admin", "cmdWho");
- register_clcmd("say_team /admin", "cmdWho");
- register_clcmd("say /admins", "cmdWho");
- register_clcmd("say_team /admins", "cmdWho");
- register_clcmd("say /admini", "cmdWho");
- register_clcmd("say_team /admini", "cmdWho");
- }
- public cmdWho( id, page ) {
- new MenuName[ 64 ], MenuExitKey[ 32 ];
- formatex( MenuName, sizeof ( MenuName ) -1, "%s", TITLU );
- formatex( MenuExitKey, sizeof ( MenuExitKey ) -1, "%s", IESIRE );
- new menu = menu_create(MenuName, "InchidereMeniu");
- if( AdminiON( ) )
- {
- for( new i = 0; i < GRUPURI; i++ )
- {
- AdaugareA( id, menu, i );
- }
- }
- else
- {
- menu_additem( menu, NOADMINS , "1", 0 );
- }
- menu_setprop(menu, MPROP_EXITNAME, MenuExitKey );
- menu_display(id, menu, page);
- }
- public InchidereMeniu(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 AdaugareA( const id, const menu, const group ) {
- new AdminMenuMessage[ 32 ][ 64 ],AdminMenuKey[ 32 ][ 32 ], MenuKey = 1;
- static Players[ 32 ], Num, Player;
- get_players( Players, Num, "ch" );
- for( new x = 0 ; x < Num ; x++ )
- {
- Player = Players[ x ];
- if( get_user_flags( Player ) == g_ValueFlaguri[ group ] )
- {
- formatex( AdminMenuMessage[ MenuKey ], sizeof ( AdminMenuMessage[ ] ) -1, "\y[*] \w%s \y\w%s%s ",
- gName( Player ), g_NumeGrade[ group ], Player == id ? "\r *" : "" );
- formatex( AdminMenuKey[ MenuKey ], sizeof ( AdminMenuKey[ ] ) -1, "%d", MenuKey );
- MenuKey++;
- }
- }
- for( new z = 1 ; z < MenuKey ; z++ )
- {
- menu_additem( menu, AdminMenuMessage[ z ], AdminMenuKey[ z ], 0 );
- }
- }
- stock bool:AdminiON( ) {
- new bool:AGasiti = false;
- static Players[ 32 ], Num, Player;
- get_players( Players, Num, "ch" );
- for( new x = 0 ; x < Num ; x++ )
- {
- Player = Players[ x ];
- for( new i = 0 ; i < GRUPURI ; i++ )
- {
- if( AGasiti ) break;
- if( get_user_flags( Player ) == g_ValueFlaguri[ i ] )
- {
- AGasiti = true;
- }
- }
- }
- return AGasiti ? true : false;
- }
- stock gName( id ) {
- new name[ 32 ];
- get_user_name( id, name, sizeof ( name ) -1 );
- return name;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement