Jump to content

Our Partners
living the best life..

[Plugin] amx_who in hud


The Guardian
 Share

Recommended Posts

- Nume plugin: amx_who

- Autor: Askhanar

- Engine  : HLDS si ReHLDS

- Versiune: 2.0

- Informatii: Cand tastati pe chat /who va aparea pe ecran in hud cu "Numele Adminului" si "Gradul" acestuia

- Download: 

Quote

#include <amxmodx>

#pragma semicolon 1


#define MAX_GROUPS 7

new g_groupNames[ MAX_GROUPS][ ] = {
    
    "Chestor",
    "Comisar Sef",
    "Comisar",
    "Subcomisar",
    "Inspector",
    "Agent Sef Pr",
    "Agent Sef"
};

new g_groupFlags[ MAX_GROUPS ][ ] = {
    
    "abcdefghijklmnopqrstu",
    "bcdefghijkmnopqrsu",
    "bcdefijmnopqru", 
    "bcdefijmnu",
    "bcdefijm",
    "bcdefij",
    "bcdeij"
};

new g_groupFlagsValue[ MAX_GROUPS ];

static const PLUGIN_NAME[ ]    = "Ultimate Who";
static const PLUGIN_VERSION[ ]   = "2.0";

static const MENU_NAME[ ] = "\r Admini Online";
static const NO_ADMINS_MENU_NAME[ ] = "\y Nu sunt admini online";
static const MENU_EXIT_NAME[ ] = "\yIesire^n^n^n\rwww.globalelite.ro";


public plugin_init( )
{
    
    register_plugin( PLUGIN_NAME, PLUGIN_VERSION, "Askhanar" );
    
    register_clcmd("say /who", "cmdWho", -1, "");
    register_clcmd("say /admins", "cmdWho", -1, "");
    register_concmd("say /admin", "cmdWho", -1, "");
    register_clcmd("say_team /who", "cmdWho", -1, "");
    register_clcmd("say_team /admins", "cmdWho", -1, "");
    register_concmd("say_team /admin", "cmdWho", -1, "");
    
    
    for( new i = 0 ; i < MAX_GROUPS ; i++ )
        g_groupFlagsValue[ i ] = read_flags( g_groupFlags[ i ] );
    
    
}
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, "ShowMenuHandler");   
    
    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 ShowMenuHandler(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 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_groupFlagsValue[ group ] )
        {

            formatex( AdminMenuMessage[ MenuKey ], sizeof ( AdminMenuMessage[ ] ) -1, "\w%s \y- \w%s%s",
                get_name( Player ), g_groupNames[ 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:AdminsOnline(    )
{
    new bool:AdminsFound = 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 < MAX_GROUPS ; i++ )
        {
            if( AdminsFound ) break;
            if( get_user_flags( Player ) == g_groupFlagsValue[ i ] )
            {
                AdminsFound = true;
            }
        }
    }
    
    return AdminsFound ? true : false;
}

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

    return name;
}

- Instalare: ->> Intrati pe ftp

->> Duceti-va in cstrike/addons/amxmodx/plugins si pune ti fisierul .amxx acolo

->> Duceti-va in cstrike/addons/amxmodx/configs/plugins.ini si adaugati linia amx_who.amxx acolo si dati Save

->> Duceti-va pe Pterodactyl / GameCP si dati un restart sau schimbati mapa.

->> Dupa tastati comanda /who si Gata ! Succes !

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...