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

[CSGO]Admins online


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DragosVI
Junior Member
Join Date: May 2019
Location: Romania
Old 12-21-2019 , 07:43   [CSGO]Admins online
Reply With Quote #1

Hi!Who can help me with this problem?Plz
#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);
}

public Action Command_ShowAdminsOnline(int client, int args)
{
for (int index = 1; index < MaxClients; index++)
{
if(IsClientInGame(index))
{
AdminId ClientAccess = GetUserAdmin(index);

if(ClientAccess)
{
int AdminGroupsCount = GetAdminGroupCount(ClientAccess);

for (int x = 0; x < AdminGroupsCount; x++)
{
char GroupName[32];

if(GetAdminGroup(ClientAccess, x, GroupName, sizeof(GroupName)) != ADMFLAG_ROOT)
{
PrintToChat(client, "\x01★\x02 Founders: \x01 %N", client );
}
else if(GetAdminGroup(ClientAccess, x, GroupName, sizeof(GroupName)) != ADMFLAG_UNBAN)
{
PrintToChat(client, "\x01★\x07 Owners: \x01 %N", client );
}
else if(GetAdminGroup(ClientAccess, x, GroupName, sizeof(GroupName)) != ADMFLAG_CUSTOM3)
{
PrintToChat(client, "\x01★\x04 Mods: \x01 %N", client );
}
else if(GetAdminGroup(ClientAccess, x, GroupName, sizeof(GroupName)) != ADMFLAG_BAN)
{
PrintToChat(client, "\x01★\x05 Admins: \x01 %N", client );
}
else if(GetAdminGroup(ClientAccess, x, GroupName, sizeof(GroupName)) != ADMFLAG_GENERIC)
{
PrintToChat(client, "\x01★\x06 Helpers: \x01 %N", client );
}
}
}
}
}
}

And ,what .inc e needed i insert in it?
And .inc?
Srry for my bad english.

Last edited by DragosVI; 12-21-2019 at 18:07.
DragosVI is offline
Stefanx
Member
Join Date: Feb 2018
Location: Romania
Old 12-21-2019 , 09:10   Re: [CSGO]Admins online
Reply With Quote #2

these
Attached Files
File Type: inc scp.inc (3.5 KB, 83 views)
File Type: inc colors.inc (13.4 KB, 73 views)

Last edited by Stefanx; 12-21-2019 at 09:10.
Stefanx is offline
DragosVI
Junior Member
Join Date: May 2019
Location: Romania
Old 12-21-2019 , 14:48   Re: [CSGO]Admins online
Reply With Quote #3

Quote:
Originally Posted by Stefanx View Post
these
SourcePawn Compiler 1.9
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2017 AlliedModders LLC

plugin.sp(23) : warning 234: symbol "FCVAR_PLUGIN" is marked as deprecated: No logic using this flag ever existed in a released game. It only ever appeared in the first hl2sdk.


plugin.sp(63) : error 174: symbol 'AdminId' is a type and cannot be used as a value
plugin.sp(70) : warning 217: loose indentation
plugin.sp(72) : error 174: symbol 'AdminId' is a type and cannot be used as a value
plugin.sp(79) : warning 217: loose indentation
plugin.sp(81) : error 174: symbol 'AdminId' is a type and cannot be used as a value
plugin.sp(8 : warning 217: loose indentation
plugin.sp(90) : error 174: symbol 'AdminId' is a type and cannot be used as a value
plugin.sp(97) : warning 217: loose indentation
plugin.sp(99) : error 174: symbol 'AdminId' is a type and cannot be used as a value
plugin.sp(106) : warning 217: loose indentation

5 Errors.
DragosVI is offline
foxhound27
AlliedModders Donor
Join Date: Sep 2019
Location: Argentina
Old 12-21-2019 , 22:37   Re: [CSGO]Admins online
Reply With Quote #4

Maybe like this

PHP Code:
public Action Command_ShowAdminsOnline(int clientint args) {

    for (
int i 1MaxClientsi++) {

        
int flags GetUserFlagBits(i);

        switch (
flags) {

        case 
ADMFLAG_ROOT:
            
PrintToChat(client"\x01★\x02 Founders: \x01 %N"i);
        case 
ADMFLAG_UNBAN:
            
PrintToChat(client"\x01★\x07 Owners: \x01 %N"i);
        case 
ADMFLAG_CUSTOM3:
            
PrintToChat(client"\x01★\x04 Mods: \x01 %N"i);
        case 
ADMFLAG_BAN:
            
PrintToChat(client"\x01★\x05 Admins: \x01 %N"i);
        case 
ADMFLAG_GENERIC:
            
PrintToChat(client"\x01★\x06 Helpers: \x01 %N"i);

        }

    }



Last edited by foxhound27; 12-22-2019 at 02:15.
foxhound27 is offline
DragosVI
Junior Member
Join Date: May 2019
Location: Romania
Old 12-22-2019 , 04:41   Re: [CSGO]Admins online
Reply With Quote #5

Quote:
Originally Posted by foxhound27 View Post
Maybe like this

PHP Code:
public Action Command_ShowAdminsOnline(int clientint args) {

    for (
int i 1MaxClientsi++) {

        
int flags GetUserFlagBits(i);

        switch (
flags) {

        case 
ADMFLAG_ROOT:
            
PrintToChat(client"\x01★\x02 Founders: \x01 %N"i);
        case 
ADMFLAG_UNBAN:
            
PrintToChat(client"\x01★\x07 Owners: \x01 %N"i);
        case 
ADMFLAG_CUSTOM3:
            
PrintToChat(client"\x01★\x04 Mods: \x01 %N"i);
        case 
ADMFLAG_BAN:
            
PrintToChat(client"\x01★\x05 Admins: \x01 %N"i);
        case 
ADMFLAG_GENERIC:
            
PrintToChat(client"\x01★\x06 Helpers: \x01 %N"i);

        }

    }


Man,i want write in chat when i write in chat !admins
★ Founders: no foudners online
★ Owners: no owner online
★ Mods: no mods online
★ Admins: no mods online
★ Helpers: no helpers online
DragosVI is offline
foxhound27
AlliedModders Donor
Join Date: Sep 2019
Location: Argentina
Old 12-22-2019 , 11:52   Re: [CSGO]Admins online
Reply With Quote #6

try something like this then

PHP Code:
public Action Command_ShowAdminsOnline(int clientint args) {

    
PrintToChat(client"\x01★\x02 Founders: \x01%s"Admins(ADMFLAG_ROOT) ? 'Online':'no founders online');
    
PrintToChat(client"\x01★\x07 Owners: \x01%s"Admins(ADMFLAG_UNBAN) ? 'Online':'no owners online');
    
PrintToChat(client"\x01★\x04 Mods: \x01%s"Admins(ADMFLAG_CUSTOM3) ? 'Online':'no mods online');
    
PrintToChat(client"\x01★\x05 Admins: \x01%s"Admins(ADMFLAG_BAN) ? 'Online':'no admins online');
    
PrintToChat(client"\x01★\x06 Helpers: \x01%s"Admins(ADMFLAG_GENERIC) ? 'Online':'no helpers online');

}


stock bool Admins(int level) {

    
bool response false;

    for (
int i 1<= MaxClientsi++) {

        if (
GetUserFlagBits(i) == level) {
            
response true;
        }
    }

    return 
response;


Or


PHP Code:
public Action Command_ShowAdminsOnline(int clientint args) {

    
PrintToChat(client"\x01★\x02 Founders: \x01%s"Admins(ADMFLAG_ROOT) ? CountAdmins(ADMFLAG_ROOT):'no founders online');
    
PrintToChat(client"\x01★\x07 Owners: \x01%s"Admins(ADMFLAG_UNBAN) ? CountAdmins(ADMFLAG_UNBAN):'no owners online');
    
PrintToChat(client"\x01★\x04 Mods: \x01%s"Admins(ADMFLAG_CUSTOM3) ? CountAdmins(ADMFLAG_CUSTOM3):'no mods online');
    
PrintToChat(client"\x01★\x05 Admins: \x01%s"Admins(ADMFLAG_BAN) ? CountAdmins(ADMFLAG_BAN):'no admins online');
    
PrintToChat(client"\x01★\x06 Helpers: \x01%s"Admins(ADMFLAG_GENERIC) ? CountAdmins(ADMFLAG_GENERIC):'no helpers online');

}


stock bool Admins(int level) {

    
bool response false;

    for (
int i 1<= MaxClientsi++) {

        if (
GetUserFlagBits(i) == level) {
            
response true;
        }
    }

    return 
response;
}

stock int CountAdmins(int level) {

    
int counter=0;

    for (
int i 1<= MaxClientsi++) {

        if (
GetUserFlagBits(i) == level) {
            
counter += 1;
        }
    }

    return 
counter;


Last edited by foxhound27; 12-22-2019 at 12:20.
foxhound27 is offline
DragosVI
Junior Member
Join Date: May 2019
Location: Romania
Old 12-22-2019 , 15:49   Re: [CSGO]Admins online
Reply With Quote #7

Thx.Solved.
DragosVI is offline
Reply


Thread Tools
Display Modes

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 05:14.


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