Thread: [Solved] [CSGO] !admins online
View Single Post
Author Message
PorcusorulMagic
Member
Join Date: Dec 2018
Location: Romania
Old 04-03-2019 , 10:22   [CSGO] !admins online
Reply With Quote #1

Hello! I tried to edit a !admins plugins , but i failded again. What i need to do? I wanted to make my own list , like:

sm_admins
★ Founders: AdminName1 , AdminName2
★ Owners: AdminName1 , AdminName2
★ Mods: AdminName1 , AdminName2
★ Admins: AdminName1 , AdminName2
★ Helpers: AdminName1 , AdminName2

sm_vips
{color}VIPs: VipName1 , VipName2

Surse:
PHP Code:
#pragma semicolon 1

#define DEBUG

#include <sourcemod>
#include <sdktools>
#include <colors>

#pragma newdecls required

public Plugin myinfo 
{
    
name "[CSGO] List of Online Admins",
    
author "",
    
description "Reply to sm_admins command the name of online admin",
    
version "",
    
url ""
};

public 
void OnPluginStart()
{
    
RegConsoleCmd("sm_admins"Command_ShowAdminsOnline);
    
RegConsoleCmd("sm_vips"Command_ShowVipsOnline);
}

public 
Action Command_ShowAdminsOnline(int clientint args)
{
    for (
int index 1index MaxClientsindex++)
    {
        if(
IsClientInGame(index))
        {
            
AdminId ClientAccess GetUserAdmin(index);
            
            if(
ClientAccess)
            {
                
int AdminGroupsCount GetAdminGroupCount(ClientAccess);
                
                for (
int x 0AdminGroupsCountx++)
                {
                    
char GroupName[32];
                    
                    if(
GetAdminGroup(ClientAccessxGroupNamesizeof(GroupName)) != ADMFLAG_ROOT)
                    {                        
                        
PrintToChat(client"\x01★\x02 Founders: \x01 %N"client );                        
                    }
                    else if(
GetAdminGroup(ClientAccessxGroupNamesizeof(GroupName)) != ADMFLAG_UNBAN)
                    {
                        
PrintToChat(client"\x01★\x07 Owners: \x01 %N"client );                        
                    }
                    else if(
GetAdminGroup(ClientAccessxGroupNamesizeof(GroupName)) != ADMFLAG_CUSTOM3)
                    {
                        
PrintToChat(client"\x01★\x04 Mods: \x01 %N"client );                        
                    }
                    else if(
GetAdminGroup(ClientAccessxGroupNamesizeof(GroupName)) != ADMFLAG_BAN)
                    {
                        
PrintToChat(client"\x01★\x05 Admins: \x01 %N"client );                        
                    }
                    else if(
GetAdminGroup(ClientAccessxGroupNamesizeof(GroupName)) != ADMFLAG_GENERIC)
                    {
                        
PrintToChat(client"\x01★\x06 Helpers: \x01 %N"client );                        
                    }
                }
            }
        }
    }
}
public 
Action Command_ShowVipsOnline(int clientint args)
{
    for (
int index 1index MaxClientsindex++)
    {
        if(
IsClientInGame(index))
        {
            
AdminId ClientAccess GetUserAdmin(index);
            
            if(
ClientAccess)
            {
                
int AdminGroupsCount GetAdminGroupCount(ClientAccess);
                
                for (
int x 0AdminGroupsCountx++)
                {
                    
char GroupName[32];
                    
                    if(
GetAdminGroup(ClientAccessxGroupNamesizeof(GroupName)) != ADMFLAG_CUSTOM6)
                    {                        
                        
PrintToChat(client"\x01★\x10 VIPs: \x01 %N"client );                        
                    }
                }
            }
        }
    }

On servers looks like this:
★ Founders: PorcusorulMagic
★ Founders: PorcusorulMagic
★ Founders: PorcusorulMagic
★ VIPs: PorcusorulMagic
★ VIPs: PorcusorulMagic
★ VIPs: PorcusorulMagic
__________________
Steam - https://steamcommunity.com/id/porcusorulmagic
Discord - PorcusorulMagic#4908

Last edited by PorcusorulMagic; 04-09-2019 at 10:11. Reason: Solved
PorcusorulMagic is offline