sql_threadquery - cannot set user flags
Hello everyone.
I got a problem - I want to connect to sql and check if player has acccess flags. Here's my example code: PHP Code:
|
Re: sql_threadquery - cannot set user flags
If you've confirmed all the plumbing is correct and you see the log_amx() line print, maybe try adding a small delay when setting flags.
Code:
|
Re: sql_threadquery - cannot set user flags
Now, I got it like this:
PHP Code:
|
Re: sql_threadquery - cannot set user flags
EDIT:
I found there is something wrong with one of my servers. When testing on another one, it works well. And if I use SQL_PrepareQuery instead of SQL_ThreadQuery it works well on all servers too. I think the problem is in set_user_flags function bacause even if set constant values ( eg: set_user_flags(1, read_flags("t")) ) it doesn't work. What you think about it? |
Re: sql_threadquery - cannot set user flags
Remember that set_user_flags() is actually add user flags. If you want to set what a player has, first use remove_user_flags() then set_user_flags().
For example, if a player has "abcdef" and you call set_user_flags( id , "t" ), his flags will then be "abcdeft" Is this your issue? Do you have any other plugins that may be adjusting flags? |
Re: sql_threadquery - cannot set user flags
I know it only adds flags. That's I want it to do.
I think I found the problem, but still don't know how to deal with it. The problem is, most of plugins checks user flags in client_authorized() function. But my plugin do only sql query in client_authorized(), but no set_user_flags() in this function too. And bacause of it, rest of plugins don't see user flags. They're updated in sql function after client_authorized. |
Re: sql_threadquery - cannot set user flags
Ok, you may need to edit those plugins to delay the flag checking.
|
Re: sql_threadquery - cannot set user flags
Well, I'd rather avoid editing every plugin I use because of this one.
|
Re: sql_threadquery - cannot set user flags
You've really got no choice. The earliest that you can identify a player with their authid is client authorized. Another option is to load flags with something more instantaneous, like nVault, and place this plugin before all others in plugins.ini
|
Re: sql_threadquery - cannot set user flags
Rather than putting a delay in every plugin, create a forward and trigger it once the user flags are loaded, you will still need to edit the plugins though, there is no other way around it.
|
All times are GMT -4. The time now is 08:38. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.