Raised This Month: $ Target: $400
 0% 

read_flags() doesn't working


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-21-2017 , 21:03   Re: read_flags() doesn't working
Reply With Quote #1

When you say that something isn't working you should clearly state what it is actually doing and what you want it to do.

I'm going to guess that the issue is actually a misunderstanding of how set_user_flags() works. It does not replace any existing flags. It only adds them to the user's already existing flags (using a bit-wise OR with the user's original flags). So, if you want to set a user to have ONLY the flags specified by read_flags() then you first need to clear the user flags.

Quote:
Originally Posted by fysiks View Post
Code:
set_user_flags(id,flags);

Code:
set_user_flags(id, -1);
set_user_flags(id,flags);
The documentation for set_user_flags() mentions the bit-wise OR functionality but it does not explicitly state that you clear flags by using a value of -1.
__________________

Last edited by fysiks; 06-21-2017 at 21:15.
fysiks is online now
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 23:10.


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