AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [CSGO] SkylerAdmins (https://forums.alliedmods.net/showthread.php?t=308606)

skyler.b 06-27-2018 06:04

[CSGO] SkylerAdmins
 
3 Attachment(s)
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 :(

Facksy 06-27-2018 10:16

Re: [CSGO] SkylerAdmins
 
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

skyler.b 06-27-2018 11:38

Re: [CSGO] SkylerAdmins
 
it is auto-include for me and I don't mind
and thanks I will remember it for next time.

kratoss1812 06-28-2018 08:49

Re: [CSGO] SkylerAdmins
 
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 )
            }
        }
    }



K1lleR_gamea 07-28-2020 04:20

Re: [CSGO] SkylerAdmins
 
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


All times are GMT -4. The time now is 06:40.

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