View Single Post
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-15-2021 , 08:29   Re: Steam group Servercommand
Reply With Quote #2

You should check after admin check callback.
To mess too much with admin privilege.

*edit
You could mention what game ? Maybe all games not support 'AuthId_Steam3'

PHP Code:
#include <steamworks>



public void OnClientPostAdminCheck(int client)
{
/*
    Called once a client is authorized and fully in-game, and after all post-connection authorizations have been performed.
    This callback is guaranteed to occur on all clients, and always after each OnClientPutInServer() call.
*/

    
if(IsFakeClient(client)) return;

    
// https://steamcommunity.com/groups/CrowbarTool
    
SteamWorks_GetUserGroupStatus(client103582791434761767);
}


public 
int SteamWorks_OnClientGroupStatus(int authidint groupidbool isMemberbool isOfficer)
{
    
char sauthid[20];
    
Format(sauthidsizeof(sauthid), "%i"authid);

    
char steamid[20];
    
int client 0;
    
    for(
int i 1<= MaxClientsi++)
    {
        if(!
IsClientInGame(i) || IsFakeClient(i)) continue;
        
        if(!
GetClientAuthId(iAuthId_Steam3steamidsizeof(steamid))) continue;
        
        if(
StrContains(steamidsauthidfalse) == -1) continue;
        
        
client i;
        break;
    }

    if(
client == 0) return; // Client not in game anymore

    // Already in admin cache
    
if(GetUserAdmin(client) != INVALID_ADMIN_ID)
    {
        if(
isMember) return;
        if(
isOfficer) return;
        
        
// Client is admin, but not in group member
        // Do code here
        
PrintToServer("%N is admin but not in group member"client);
    }
    else if(
isMember)
    {
        
// Client not admin, but is member
        // Do code here
        
PrintToServer("%N is not admin but in group member"client);
    }



__________________
Do not Private Message @me

Last edited by Bacardi; 02-15-2021 at 08:34.
Bacardi is offline