Raised This Month: $51 Target: $400
 12% 

[CSGO] SkylerAdmins


Post New Thread Reply   
 
Thread Tools Display Modes
Author
skyler.b
AlliedModders Donor
Join Date: Dec 2017
Location: israel
Plugin ID:
6179
Plugin Version:
0.01
Plugin Category:
General Purpose
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    plugin allows to the admin change the status on/off to the server using menu
    Old 06-27-2018 , 06:04   [CSGO] SkylerAdmins
    Reply With Quote #1

    SkylerAdmins v0.01


    Description:
    a plugin for general purpose in any csgo server displaying the online admins to the client.

    commands:
    /admins 0/1
    only an admin can activate the command

    /admins
    Displaying menu of the online admins


    Found a bug or have an idea write it to me and I will look up for it!



    Credits:
    empty this time
    Attached Files
    File Type: sp Get Plugin or Get Source (SkylerAdmins.sp - 528 views - 2.2 KB)
    File Type: smx SkylerAdmins.smx (5.6 KB, 513 views)
    File Type: inc skyler.inc (4.0 KB, 437 views)
    __________________
    Taking private requests

    part of the gurney is the end.

    Last edited by skyler.b; 06-27-2018 at 06:06.
    skyler.b is offline
    Facksy
    Senior Member
    Join Date: Apr 2017
    Location: +2+2
    Old 06-27-2018 , 10:16   Re: [CSGO] SkylerAdmins
    Reply With Quote #2

    Why do you include these files if you dont use them?
    Code:
    #include <sdktools>
    #include <cstrike>
    #include <sdkhooks>
    Your plugin will work on other source games if you don't include cstrike
    Facksy is offline
    skyler.b
    AlliedModders Donor
    Join Date: Dec 2017
    Location: israel
    Old 06-27-2018 , 11:38   Re: [CSGO] SkylerAdmins
    Reply With Quote #3

    it is auto-include for me and I don't mind
    and thanks I will remember it for next time.
    __________________
    Taking private requests

    part of the gurney is the end.
    skyler.b is offline
    kratoss1812
    Senior Member
    Join Date: May 2018
    Location: Romānia
    Old 06-28-2018 , 08:49   Re: [CSGO] SkylerAdmins
    Reply With Quote #4

    Great Plugin! For future update you can add the group of admin!
    Example:

    PHP Code:
    #include <sourcemod>
    #include <colors>

    public Plugin:myinfo = {
        
    name "Admin List ",
        
    author "Skyler feat. kRatoss",
        
    description "",
        
    version "1.0",
        
    url ""
    }

    public 
    OnPluginStart( ) {
        
    RegConsoleCmd"sm_admins"Command_ShowAdminsOnline )
    }

    public 
    ActionCommand_ShowAdminsOnlineclientargs 
    {
        new 
    Handle:AdminsOnline CreateMenuAdminsOnline_Handler )
        
    SetMenuTitleAdminsOnline"Admin Name | Admin Group" )
        
        
    int Admins 0
        
        
    for( new index 1index MaxClientsindex++ ) 
        {
            if( 
    IsClientInGameindex ) ) 
            {
                new 
    AdminIdClientAccess GetUserAdminindex )
                
                if( 
    ClientAccess 
                {
                    new 
    AdminGroupsCount GetAdminGroupCountClientAccess )
                    
                    for( new 
    0AdminGroupsCountx++ ) 
                    {
                        
    decl String:GroupBuffer32 ]
                        
                        if( ( 
    GetAdminGroupClientAccessxGroupBuffersizeofGroupBuffer ) ) != INVALID_GROUP_ID ) ) 
                        {
                            
    Admins++
                            
                            
    decl StringAdminNameAndGroup64 ]
                            
    FormatAdminNameAndGroupsizeofAdminNameAndGroup ), "%N | %s"indexGroupBuffer )
                            
                            
    AddMenuItemAdminsOnline"selected"AdminNameAndGroup )
                        }
                    }
                }
            }
        }
        
        if( 
    Admins <= 
        {
            
    PrintToChatclient"*\x02 No admins online!" )
        }
        
        
    SetMenuExitButtonAdminsOnlinetrue )
        
    DisplayMenuAdminsOnlineclient30 )
    }

    public 
    AdminsOnline_HandlerHandle:AdminsOnlineMenuAction:actionposneg ) {
        switch( 
    action ) {
            case 
    MenuAction_Select: {
                
    decl StringInfo32 ]
                
    GetMenuItemAdminsOnlinenegInfosizeofInfo ) )
                
                if( 
    StrEqualInfo"selected" ) ) {
                    if( 
    AdminsOnline != INVALID_HANDLE ) {
                        
    CancelMenuAdminsOnline )
                    }
                }
            }
            
            case 
    MenuAction_End: {
                if( 
    AdminsOnline != INVALID_HANDLE ) {
                    
    CancelMenuAdminsOnline )
                }
            }
        }

    kratoss1812 is offline
    K1lleR_gamea
    Junior Member
    Join Date: Mar 2019
    Location: Israel
    Old 07-28-2020 , 04:20   Re: [CSGO] SkylerAdmins
    Reply With Quote #5

    PHP Code:
    #pragma semicolon 1

    #define DEBUG

    #define PLUGIN_AUTHOR "Skyler"
    #define PLUGIN_VERSION "1.0.1"
    #define PREFIX "SkylerAdmins"

    #include <sourcemod>
    #include <clientprefs>

    Handle g_hAdminStatus;

    public 
    Plugin myinfo = {
        
    name "[ANY] Admins Online"
        
    author PLUGIN_AUTHOR
        
    description "Made aspecailly by Skyler"
        
    version PLUGIN_VERSION
        
    url "https://forums.alliedmods.net/showthread.php?t=308606"
    };

    public 
    void OnPluginStart(){
        
    RegConsoleCmd("sm_admins"Cmd_Admins);
        
    g_hAdminStatus RegClientCookie("sm_admins_status""Sets the admin visibility on the online admin list"CookieAccess_Protected);
    }

    public 
    Action Cmd_Admins(int clientint args){
        if (
    IsValidClient(client)){
            
    char szArg[32];
            
    GetCmdArg(1szArgsizeof(szArg));
            
            if (
    args == && CheckForAdmin(client)){
                if (
    StrEqual(szArg"0")){
                    
    PrintToChat(client" \x0E[\x0C%s\x0E]\x04 You have changed your admin visibility to \x07off\x01."PREFIX);
                    
    SetClientCookie(clientg_hAdminStatus"0");
                    
                } else if (
    StrEqual(szArg"1")){
                    
    PrintToChat(client" \x0E[\x0C%s\x0E]\x04 You have changed your admin visibility to \x04on\x01."PREFIX);
                    
    SetClientCookie(clientg_hAdminStatus"1");
                    
                } else {
                    
    PrintToChat(client" \x0E[\x0C%s\x0E]\x04 You can only the admin visibility status to \x041\x01/\x070\x01."PREFIX);
                    return 
    Plugin_Handled;
                }
                
            } else if (
    args == 0){
                
    Menu_Admins(client);
            }
        }
        return 
    Plugin_Handled;
    }

    void Menu_Admins(int client){
        
    Menu menu = new Menu(MenuCallBack_Admins);
        
    menu.SetTitle("[%s] Online Admins"PREFIX);
        
        
    char szStatus[512];
        
    char szName[MAX_NAME_LENGTH];
        
        for (
    int i 1<= MaxClientsi++){
            
    GetClientCookie(ig_hAdminStatusszStatussizeof(szStatus));
            
            if (
    IsValidClient(i) && CheckForAdmin(i) && StrEqual(szStatus"1")){
                
    Format(szNamesizeof(szName), "%N"i);
                
    menu.AddItem(""szName);
            }
        }
        
        
    menu.ExitButton true;
        
    menu.Display(clientMENU_TIME_FOREVER);
    }

    public 
    int MenuCallBack_Admins(Menu menuMenuAction mActionint param1int param2){
        if (
    mAction == MenuAction_Select){
            
    Menu_Admins(param1);
            
        } else if (
    mAction == MenuAction_End){
            
    delete menu;
        }
    }

    stock bool CheckForAdmin(int client){
        if (
    client >= && client <= MaxClients && CheckCommandAccess(client""ADMFLAG_SLAY)){
            return 
    true;
        }
        return 
    false;
    }

    stock bool IsValidClient(int client){
        if (
    client >= && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client) && !IsFakeClient(client) && !IsClientSourceTV(client) && !IsClientReplay(client)){
            return 
    true;
        }
        return 
    false;

    I think it's much easier
    K1lleR_gamea 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 23:53.


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