Raised This Month: $12 Target: $400
 3% 

What did the FindAdminByIdentity?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 01-03-2021 , 07:41   What did the FindAdminByIdentity?
Reply With Quote #1

Not sure that I can fully understood how it works.. FindAdminByIdentity finds where?

Last edited by ZASTRELIS; 01-03-2021 at 07:41.
ZASTRELIS is offline
AePT
Member
Join Date: Jan 2016
Old 01-03-2021 , 09:31   Re: What did the FindAdminByIdentity?
Reply With Quote #2

With this function you can find an administrator through SteamId, for example...

PHP Code:
#include <sourcemod>

public Plugin myinfo =
{
    
name "Check Admin",
    
author "sekm",
    
description "",
    
version "1.0",
    
url "https://steamcommunity.com/id/h5r/"
};

public 
void OnPluginStart()
{
    
RegConsoleCmd("sm_checkadmin"Command_CheckAdmin);
}

public 
Action Command_CheckAdmin(int iClientint iArgs)
{
    
AdminId iAdmin FindAdminByIdentity("steam""STEAM_0:0:1347337");

    if (
iAdmin != INVALID_ADMIN_ID)
    {
         
PrintToChatAll("SteamId: STEAM_0:0:1347337 has admin");
    }
    else
    {
         
PrintToChatAll("SteamId: STEAM_0:0:1347337 has not a admin");
    }

Greetings!

Last edited by AePT; 01-03-2021 at 23:28.
AePT is offline
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 01-04-2021 , 06:34   Re: What did the FindAdminByIdentity?
Reply With Quote #3

It looks to flat admin files include the db? Or DB separately?
How I can remove my admin? If I use RemoveAdmin method, it delete admin from all files and db?
ZASTRELIS is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 01-04-2021 , 09:30   Re: What did the FindAdminByIdentity?
Reply With Quote #4

No, admins are read from the files or the database and stored in an in-memory cache. Functions like FindAdminByIdentity and RemoveAdmin then use that cache to find and remove admins.

There are no functions to add/remove admins from the files or SQL database, but the sql-admin-manager plugin provides commands for the latter.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.

Last edited by DJ Tsunami; 01-04-2021 at 09:38.
DJ Tsunami 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 18:14.


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