Good day,
I have a question related to Admin Cache and AdminId, I was looking into
admin-sql-threaded plugin and other similar plugins, I found that all those plugins are using Admin Cache (OnRebuildAdminCache, OnClientPreAdminCheck and other functions).
However, I found some other functions which provide you ability to grant admin access for players.
PHP Code:
public void OnClientAuthorized(int client, const char[] auth)
{
if (IsFakeClient(client)) {
return;
}
char flags[32];
strcopy(flags, sizeof(flags), "abcdefghjklmn");
int immunity = 99;
AdminId Admin = CreateAdmin();
AdminFlag Flag;
SetAdminImmunityLevel(Admin, immunity);
for (int i = 0; i < strlen(flags); i++) {
if (!FindFlagByChar(flags[i], Flag)) {
continue;
}
Admin.SetFlag(Flag, true);
}
SetUserAdmin(client, Admin, true);
}
As you can see this method is really simple, I want to use this method because I want to build my own plugin to connect all players and admins in the same database and identify them by ID.
Questions:- What kind of problems I may face while using this method?
- In terms of performance, this method is the same, worse, better?
- What if we make an assumption that we have 200, 500 or 1000 admins in the database? How performance changes?
If you have any comments or suggestions, feel free to share it.
Thank you guys.