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

Solved Help about admin flag


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
maclarens
Senior Member
Join Date: Jul 2020
Location: Kz
Old 08-27-2023 , 09:21   Help about admin flag
Reply With Quote #1

Hello!I need players who have the admin flag then the code below is not executed, my code does not work where is the error?


Code:
public void OnClientPutInServer(int client)
{
    if (client && IsClientConnected(client))
    {
        if (!GetAdminFlag(GetUserAdmin(client), Admin_Root))
        {
            SetUserFlagBits(client, ADMFLAG_CUSTOM1);
        }
    }
}
I log in as admin and my flags are all erased except ADMFLAG_CUSTOM1

Last edited by maclarens; 09-13-2023 at 08:42.
maclarens is offline
maclarens
Senior Member
Join Date: Jul 2020
Location: Kz
Old 08-27-2023 , 15:14   Re: Help about admin flag
Reply With Quote #3

this not working for me,all my admin flag erase when im in to game!
maclarens is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 08-29-2023 , 07:00   Re: Help about admin flag
Reply With Quote #4

Quote:
Originally Posted by maclarens View Post
my code does not work where is the error?
Click image for larger version

Name:	изображение_2023-08-29_1400125.png
Views:	67
Size:	50.8 KB
ID:	201453
https://sm.alliedmods.net/new-api/cl...entPutInServer
__________________

Last edited by Grey83; 08-29-2023 at 07:02.
Grey83 is offline
maclarens
Senior Member
Join Date: Jul 2020
Location: Kz
Old 08-30-2023 , 07:43   Re: Help about admin flag
Reply With Quote #5

if u admin then yes its work!but if u just players then this flag not add anyway.>> SetUserFlagBits(client, ADMFLAG_CUSTOM1);
i need add flag to player and ignore if u admin.
maclarens is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 08-30-2023 , 09:12   Re: Help about admin flag
Reply With Quote #6

PHP Code:
public void OnClientPostAdminCheck(int client)
{
    if(!
IsFakeClient(client) && !(GetUserFlagBits(client) & (ADMFLAG_ROOT|ADMFLAG_CUSTOM1)))
        
AddUserFlags(clientAdmin_Custom1);

__________________

Last edited by Grey83; 08-30-2023 at 09:13.
Grey83 is offline
maclarens
Senior Member
Join Date: Jul 2020
Location: Kz
Old 08-30-2023 , 09:44   Re: Help about admin flag
Reply With Quote #7

Quote:
Originally Posted by Grey83 View Post
PHP Code:
public void OnClientPostAdminCheck(int client){    if(!IsFakeClient(client) && !(GetUserFlagBits(client) & (ADMFLAG_ROOT|ADMFLAG_CUSTOM1)))        AddUserFlags(clientAdmin_Custom1);} 
yes thx right
maclarens is offline
Reply



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 00:02.


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