read_flags() doesn't working
Why ain't the read_flags() working?
PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
Re: set_user_flags() doesn't working
Try test with has_flag.
Code:
set user flags with ADMIN_LEVEL_H instead of t https://forums.alliedmods.net/showpo...93&postcount=2 |
Re: set_user_flags() doesn't working
The get_user_flags() works fine. I tested with log_amx() and it prints the message. The problem is the read_flags().
Tried the code: PHP Code:
|
Re: read_flags() doesn't working
|
Re: read_flags() doesn't working
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:
|
Re: read_flags() doesn't working
Basically, I meant correctly. It actually wasn't working. I didn't knew that firstly we need to clear and after it, set.
But like, I want not clear all user's flags, I just want to add two more. |
Re: read_flags() doesn't working
Quote:
Quote:
Quote:
The code that you have posted doesn't show that read_flags() isn't working. If you think read_flags() is causing your issue then you need to test read_flags() alone. E.g.: Code:
server_print("%d", read_flags("qt")) |
Re: read_flags() doesn't working
Yes, I already did the same as you said. I always do a debug before ask something here.
Firtly, I didn't know which format I should use to show the read_flags()'s value. %s or %d ( I don't know how to call those ). Then, I used it PHP Code:
Code:
L 06/21/2017 - 21:30:04: [Access_VIP.amxx] |
Re: read_flags() doesn't working
That is because the format fails because you are passing an integer into a placeholder for a string.
read_flags() returns an integer. If you are unsure of what something returns, you should use separate format/print functions for each one. |
Re: read_flags() doesn't working
I used %d too.
|
| All times are GMT -4. The time now is 23:10. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.