Raised This Month: $32 Target: $400
 8% 

AddUserFlags


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 10-06-2019 , 14:52   AddUserFlags
Reply With Quote #1

Hi,

I am messing again with the permission stuff.

Why would this instruction not work ?

Code:
RegConsoleCmd("sm_t", CMD_Test, "test");

public Action CMD_Test(int client, int args)
{
	AddUserFlags(client, view_as<AdminFlag>(31));
	
	return Plugin_Handled;
}
https://sm.alliedmods.net/new-api/clients/AddUserFlags

as '31' should be reservation, generic, kick, slay, chat, vote and custom3, right ?

If I try to do a sm_who afterward, permission level is stuck to 'none'.
__________________
Want to check my plugins ?
Arkarr is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 10-06-2019 , 15:53   Re: AddUserFlags
Reply With Quote #2

Nevermind. Here is the fix :

PHP Code:
public Action CMD_Test(int clientint args)
{
    
AdminFlag flags[22];
    
    
FlagBitsToArray(31flagssizeof(flags));
    
    
AddUserFlags(clientflags);
    
    return 
Plugin_Handled;



Nope, still nothing.
__________________
Want to check my plugins ?

Last edited by Arkarr; 10-06-2019 at 15:56.
Arkarr is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 10-06-2019 , 17:46   Re: AddUserFlags
Reply With Quote #3

Quote:
Originally Posted by Arkarr View Post
https://sm.alliedmods.net/new-api/clients/AddUserFlags

as '31' should be reservation, generic, kick, slay, chat, vote and custom3, right ?
No. The ... in the docs mean it's a variadic function. AdminFlag is an enum and you pass it any number of individual flags.

You might be looking for SetUserFlagBits.
Fyren is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 10-07-2019 , 04:39   Re: AddUserFlags
Reply With Quote #4

Yep, obviously. My bad.
__________________
Want to check my plugins ?
Arkarr 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 20:54.


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