Raised This Month: $32 Target: $400
 8% 

Admin Check Color Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 12-05-2021 , 16:26   Admin Check Color Help
Reply With Quote #1

Hi guys I have this sma

PHP Code:
#include <amxmodx>

/*---------------EDIT ME------------------*/
#define ADMIN_CHECK ADMIN_KICK

static const COLOR[] = "^x04" //green
static const CONTACT[] = ""
/*----------------------------------------*/

new maxplayers
new gmsgSayText

public plugin_init() {
    
register_plugin("Admin Check""1.51""OneEyed")
    
maxplayers get_maxplayers()
    
gmsgSayText get_user_msgid("SayText")
    
register_clcmd("say""handle_say")
    
register_cvar("amx_contactinfo"CONTACTFCVAR_SERVER)
}

public 
handle_say(id) {
    new 
said[192]
    
read_args(said,192)
    if( ( 
containi(said"who") != -&& containi(said"admin") != -) || contain(said"/admin") != -)
        
set_task(0.1,"print_adminlist",id)
    return 
PLUGIN_CONTINUE
}

public 
print_adminlist(user
{
    new 
adminnames[33][32]
    new 
message[256]
    new 
contactinfo[256], contact[112]
    new 
idcountxlen
    
    
for(id id <= maxplayers id++)
        if(
is_user_connected(id))
            if(
get_user_flags(id) & ADMIN_CHECK)
                
get_user_name(idadminnames[count++], 31)

    
len format(message255"%s ADMINS ONLINE: ",COLOR)
    if(
count 0) {
        for(
count x++) {
            
len += format(message[len], 255-len"%s%s "adminnames[x], < (count-1) ? ", ":"")
            if(
len 96 ) {
                
print_message(usermessage)
                
len format(message255"%s ",COLOR)
            }
        }
        
print_message(usermessage)
    }
    else {
        
len += format(message[len], 255-len"No admins online.")
        
print_message(usermessage)
    }
    
    
get_cvar_string("amx_contactinfo"contact63)
    if(
contact[0])  {
        
format(contactinfo111"%s Contact Server Admin -- %s"COLORcontact)
        
print_message(usercontactinfo)
    }
}

print_message(idmsg[]) {
    
message_begin(MSG_ONEgmsgSayText, {0,0,0}, id)
    
write_byte(id)
    
write_string(msg)
    
message_end()

codes : /admin & /admins
Show me if Online Admins
hud
!yAdmins online:
red%s, %s, %s, %s.
If no Admins
!y Admins online:
redNo admins online.

Can some one ?
Showmessage : TOP Left Under the radar


IMAGE To understand where the hud exect <3
https://ibb.co/D87LQwX

Last edited by SHIFT0; 12-05-2021 at 16:29.
SHIFT0 is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 12-06-2021 , 05:20   Re: Admin Check Color Help
Reply With Quote #2

so you want to change from chat message to hud? or keep both?
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 12-06-2021 , 13:19   Re: Admin Check Color Help
Reply With Quote #3

Yup bro
With color
SHIFT0 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-06-2021 , 14:27   Re: Admin Check Color Help
Reply With Quote #4

Quote:
Originally Posted by SHIFT0 View Post
Yup bro
With color
You answered a "A or B" question with "yes".
He specifically asked if you want to keep BOTH or remove ONE.

Last edited by OciXCrom; 12-09-2021 at 15:58.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 12-10-2021 , 16:13   Re: Admin Check Color Help
Reply With Quote #5

Quote:
Originally Posted by Nutu_ View Post
so you want to change from chat message to hud? or keep both?
HUD
SHIFT0 is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 12-11-2021 , 01:50   Re: Admin Check Color Help
Reply With Quote #6

Hud:

Code:
#include <amxmodx> const TASK_HUD = 334699 new g_iHudMessageSync public plugin_init( ) {     register_plugin( "Admin's Online", "1.0.0", "Supremache" );         g_iHudMessageSync = CreateHudSyncObj( ); } public client_putinserver(id) {     if( task_exists( TASK_HUD ) )     {         set_task( 1.0, "DisplayAdminOnline", id + TASK_HUD, .flags = "b" );     } } public DisplayAdminOnline( id ) {     id -= TASK_HUD         new szBuffer[ 192 ], szPlayers[ 32 ], szName[ 32 ], iIndex, iPlayer, iNum;     set_hudmessage( 255, 255, 0, 0.03, 0.28, 2, 0.02, 1.0, 0.01, 0.1, 10 );     formatex( szBuffer, charsmax( szBuffer ), "Admin's Online:^n" );         get_players( szPlayers, iNum, "ch" );         for( new i = 0; i < iNum; i++ )     {         iIndex = szPlayers[ i ];                 if( get_user_flags( iIndex ) & ADMIN_ADMIN )         {             iPlayer++             get_user_name( iIndex, szName, charsmax( szName ) )             format( szBuffer, charsmax( szBuffer ), "%s%s%s", szBuffer, szName, iPlayer == iNum ? "." : "^n" );         }     }         if( !iPlayer )     {         add( szBuffer, charsmax( szBuffer ), "There are no admin's online.");     }         ShowSyncHudMsg( id, g_iHudMessageSync, szBuffer ) }

Menu:

Code:
#include <amxmodx> public plugin_init( ) {     register_plugin( "Admin's Online", "1.0.0", "Supremache" );         register_clcmd( "say /admins", "Admin_Online_Menu" )     register_clcmd( "say_team /admins", "Admin_Online_Menu" ) } public Admin_Online_Menu( id ) {     new szData[ 512 ], szPlayers[ 32 ], szName[ 32 ], iPlayer, iNum;             new iMenu = menu_create( "Admin Online:", "Admin_Online_Handler" )         get_players( szPlayers, iNum, "ch" );         for( new i = 0; i < iNum; i++ )     {         iPlayer = szPlayers[ i ];                 if( get_user_flags( iPlayer ) & ADMIN_ADMIN )         {             get_user_name( iPlayer, szName, charsmax( szName ) )             formatex( szData, charsmax( szData ), "%s", szName );         }         else         {             formatex( szData, charsmax( szData ), "\yThere are no admin's online." );         }         menu_additem( iMenu, szData )     }     menu_setprop( iMenu, MPROP_BACKNAME, "Previous page" )     menu_setprop( iMenu, MPROP_NEXTNAME, "Next page" )     menu_setprop( iMenu, MPROP_EXITNAME, "\rClose" )             menu_display(id, iMenu)     return PLUGIN_HANDLED; } public Admin_Online_Handler(id, iMenu, iItem) {     menu_destroy( iMenu )     return PLUGIN_HANDLED; }
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 12-11-2021 at 07:50.
Supremache is offline
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 12-11-2021 , 06:31   Re: Admin Check Color Help
Reply With Quote #7

Quote:
Originally Posted by Supremache View Post
Hud:

Code:
#include <amxmodx> const TASK_HUD = 334699 new g_iHudMessageSync public plugin_init( ) {     register_plugin( "Admin's Online", "1.0.0", "Supremache" );         g_iHudMessageSync = CreateHudSyncObj( ); } public client_putinserver(id) {     if( task_exists( TASK_HUD ) )     {         set_task( 1.0, "OnAdminOnline", id + TASK_HUD, .flags = "b" );     } } public DisplayAdminOnline( id ) {     id -= TASK_HUD         new szBuffer[ 192 ], szPlayers[ 32 ], szName[ 32 ], iIndex, iPlayer, iNum;     set_hudmessage( 255, 255, 0, 0.03, 0.28, 2, 0.02, 1.0, 0.01, 0.1, 10 );     formatex( szBuffer, charsmax( szBuffer ), "Admin's Online:^n" );         get_players( szPlayers, iNum, "ch" );         for( new i = 0; i < iNum; i++ )     {         iIndex = szPlayers[ i ];                 if( get_user_flags( iIndex ) & ADMIN_ADMIN )         {             iPlayer++             get_user_name( iIndex, szName, charsmax( szName ) )             format( szBuffer, charsmax( szBuffer ), "%s%s%s", szBuffer, szName, iPlayer == iNum ? "." : "^n" );         }     }         if( !iPlayer )     {         add( szBuffer, charsmax( szBuffer ), "There are no admin's online.");     }         ShowSyncHudMsg( id, g_iHudMessageSync, szBuffer ) }

Menu:

Code:
#include <amxmodx> public plugin_init( ) {     register_plugin( "Admin's Online", "1.0.0", "Supremache" );         register_clcmd( "say /admins", "Admin_Online_Menu" )     register_clcmd( "say_team /admins", "Admin_Online_Menu" ) } public Admin_Online_Menu( id ) {     new szData[ 512 ], szPlayers[ 32 ], szName[ 32 ], iPlayer, iNum;             new iMenu = menu_create( "Admin Online:", "Admin_Online_Handler" )         get_players( szPlayers, iNum, "ch" );         for( new i = 0; i < iNum; i++ )     {         iPlayer = szPlayers[ i ];                 get_user_name( iPlayer, szName, charsmax( szName ) )                 formatex( szData, charsmax( szData ), "%s", get_user_flags( iPlayer ) & ADMIN_ADMIN ? szName : "\yThere are no admin's online." );         menu_additem( iMenu, szData )     }     menu_setprop( iMenu, MPROP_BACKNAME, "Previous page" )     menu_setprop( iMenu, MPROP_NEXTNAME, "Next page" )     menu_setprop( iMenu, MPROP_EXITNAME, "\rClose" )             menu_display(id, iMenu)     return PLUGIN_HANDLED; } public Admin_Online_Handler(id, iMenu, iItem) {     menu_destroy( iMenu )     return PLUGIN_HANDLED; }
Ty Supremache !
but which one i can use ?
One or Two ?
SHIFT0 is offline
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 12-11-2021 , 06:35   Re: Admin Check Color Help
Reply With Quote #8

Quote:
Originally Posted by Supremache View Post
Hud:

Code:
#include <amxmodx> const TASK_HUD = 334699 new g_iHudMessageSync public plugin_init( ) {     register_plugin( "Admin's Online", "1.0.0", "Supremache" );         g_iHudMessageSync = CreateHudSyncObj( ); } public client_putinserver(id) {     if( task_exists( TASK_HUD ) )     {         set_task( 1.0, "OnAdminOnline", id + TASK_HUD, .flags = "b" );     } } public DisplayAdminOnline( id ) {     id -= TASK_HUD         new szBuffer[ 192 ], szPlayers[ 32 ], szName[ 32 ], iIndex, iPlayer, iNum;     set_hudmessage( 255, 255, 0, 0.03, 0.28, 2, 0.02, 1.0, 0.01, 0.1, 10 );     formatex( szBuffer, charsmax( szBuffer ), "Admin's Online:^n" );         get_players( szPlayers, iNum, "ch" );         for( new i = 0; i < iNum; i++ )     {         iIndex = szPlayers[ i ];                 if( get_user_flags( iIndex ) & ADMIN_ADMIN )         {             iPlayer++             get_user_name( iIndex, szName, charsmax( szName ) )             format( szBuffer, charsmax( szBuffer ), "%s%s%s", szBuffer, szName, iPlayer == iNum ? "." : "^n" );         }     }         if( !iPlayer )     {         add( szBuffer, charsmax( szBuffer ), "There are no admin's online.");     }         ShowSyncHudMsg( id, g_iHudMessageSync, szBuffer ) }

Menu:

Code:
#include <amxmodx> public plugin_init( ) {     register_plugin( "Admin's Online", "1.0.0", "Supremache" );         register_clcmd( "say /admins", "Admin_Online_Menu" )     register_clcmd( "say_team /admins", "Admin_Online_Menu" ) } public Admin_Online_Menu( id ) {     new szData[ 512 ], szPlayers[ 32 ], szName[ 32 ], iPlayer, iNum;             new iMenu = menu_create( "Admin Online:", "Admin_Online_Handler" )         get_players( szPlayers, iNum, "ch" );         for( new i = 0; i < iNum; i++ )     {         iPlayer = szPlayers[ i ];                 get_user_name( iPlayer, szName, charsmax( szName ) )                 formatex( szData, charsmax( szData ), "%s", get_user_flags( iPlayer ) & ADMIN_ADMIN ? szName : "\yThere are no admin's online." );         menu_additem( iMenu, szData )     }     menu_setprop( iMenu, MPROP_BACKNAME, "Previous page" )     menu_setprop( iMenu, MPROP_NEXTNAME, "Next page" )     menu_setprop( iMenu, MPROP_EXITNAME, "\rClose" )             menu_display(id, iMenu)     return PLUGIN_HANDLED; } public Admin_Online_Handler(id, iMenu, iItem) {     menu_destroy( iMenu )     return PLUGIN_HANDLED; }
It is like this ?
When say /admin & /admins
https://imgbb.com/D87LQwX
SHIFT0 is offline
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 12-11-2021 , 06:48   Re: Admin Check Color Help
Reply With Quote #9

Quote:
Originally Posted by SHIFT0 View Post
It is like this ?
When say /admin & /admins
https://imgbb.com/D87LQwX
https://ibb.co/9N1fZYX
Iam already ADMIN
am already have access
i want to see
\y Admins online:
\r null.
\r %s
\r %s


\r0.\wExit
SHIFT0 is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 12-11-2021 , 07:27   Re: Admin Check Color Help
Reply With Quote #10

Use what you like they are doing the same thing but they are not the same looks
Change ADMIN_ADMIN to any access
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:53.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode