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

Set user FLAG ROOT


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alex2001
Member
Join Date: May 2019
Old 05-30-2019 , 05:50   Set user FLAG ROOT
Reply With Quote #1

hi i want to add ROOT flag if player steamid == "....."

i try with this

public Event_RoundStart(Handle:event, String:name[], bool:dontBroadcast) {
decl String:authid[64];
for (new i = 1; i <= MaxClients;i++){
GetClientAuthId(i,AuthId_Steam2, authid, 63);
if (StrEqual("STEAM_1:0:244123014",authid)){
PrintToChat(i, "GG");
SetUserFlagBits(i,FlagToBit(Admin_Root));
}
}
}

and another but dosent work
alex2001 is offline
farawayf
Senior Member
Join Date: Jan 2019
Old 05-30-2019 , 11:17   Re: Set user FLAG ROOT
Reply With Quote #2

try this
PHP Code:

public void OnClientPostAdminCheck(int client) {
    
char sid[40];
    if(
GetClientAuthId(clientAuthId_Steam2sidsizeof(sid))) {
        if(
StrEqual(sid"STEAM_1:0:244123014")) {
            if(~
GetUserFlagBits(client) & ADMFLAG_ROOT) {
                
SetUserFlagBits(clientADMFLAG_ROOT);
                
// ServerCommand("sm_reloadadmins");
            
}    
        }    
    }


Last edited by farawayf; 05-30-2019 at 11:24.
farawayf is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 05-30-2019 , 11:32   Re: Set user FLAG ROOT
Reply With Quote #3

This is a terrible idea to mess with flags.
Try using my GroupAssigner, and making a group that has the Root flag (not sure why you would need that):
https://github.com/MitchDizzle/GroupHandlerAPI
https://github.com/MitchDizzle/Group...oupAssigner.md

Last edited by Mitchell; 05-30-2019 at 11:33.
Mitchell is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 05-30-2019 , 12:51   Re: Set user FLAG ROOT
Reply With Quote #4

Why are you not putting this admin in the normal admin system?

Adding a root admin by SteamID in a plugin sounds extremely shady.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
alex2001
Member
Join Date: May 2019
Old 05-30-2019 , 14:04   Re: Set user FLAG ROOT
Reply With Quote #5

i want to learn different function..i m new in sourcemod..
alex2001 is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 06-01-2019 , 16:18   Re: Set user FLAG ROOT
Reply With Quote #6

If you want to learn, open:

https://wiki.alliedmods.net/Adding_Admins_(SourceMod)
https://wiki.alliedmods.net/Adding_Groups_(SourceMod)
https://wiki.alliedmods.net/Checking...eMod_Scripting)
https://wiki.alliedmods.net/Overridi...ess_(SourceMod)

read, think, use.
Then, open source code of SourceMod basic plugins (e.g. /admin-flatfile/) and study.

I would begin with learning of new syntax and basic things first.

New permissions on admin can be granted by modifying its AdminId and re-assigning with SetUserAdmin().
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas 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 12:47.


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