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(client, 103582791434761767);
}
public int SteamWorks_OnClientGroupStatus(int authid, int groupid, bool isMember, bool isOfficer)
{
char sauthid[20];
Format(sauthid, sizeof(sauthid), "%i", authid);
char steamid[20];
int client = 0;
for(int i = 1; i <= MaxClients; i++)
{
if(!IsClientInGame(i) || IsFakeClient(i)) continue;
if(!GetClientAuthId(i, AuthId_Steam3, steamid, sizeof(steamid))) continue;
if(StrContains(steamid, sauthid, false) == -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);
}
}
__________________