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

possible bug in admin flags when player times out?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
loki_himself
Member
Join Date: Nov 2021
Old 09-20-2022 , 08:16   possible bug in admin flags when player times out?
Reply With Quote #1

...

Last edited by loki_himself; 11-23-2022 at 12:12.
loki_himself is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-21-2022 , 00:43   Re: possible bug in admin flags when player times out?
Reply With Quote #2

Flags are stored on the server, not the client. Are you getting the same slot when you re-join the server?

Also, flags for each user are cleared when the client is authorized (client_authorized) and when they are put in the server (client_putinserver).

How are you being authenticated in those servers? Are you using SteamID? Also, have you verified with an actual Steam server (i.e. not ReHLDS)?
__________________
fysiks is offline
loki_himself
Member
Join Date: Nov 2021
Old 09-21-2022 , 08:59   Re: possible bug in admin flags when player times out?
Reply With Quote #3

...

Last edited by loki_himself; 11-23-2022 at 13:26.
loki_himself is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-22-2022 , 00:18   Re: possible bug in admin flags when player times out?
Reply With Quote #4

Yes, for anything related to admin access, you should do after client_authorized() and all plugins should be below admin.amxx in plugins.ini.
__________________
fysiks is offline
loki_himself
Member
Join Date: Nov 2021
Old 09-22-2022 , 05:59   Re: possible bug in admin flags when player times out?
Reply With Quote #5

...

Last edited by loki_himself; 11-23-2022 at 13:26.
loki_himself is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-22-2022 , 22:53   Re: possible bug in admin flags when player times out?
Reply With Quote #6

You can easily wait for both to be true like this:

PHP Code:
new Bool:g_bInServerBool:g_bAuthorized

public client_putinserver(id)
{
    
g_bInServer true;
    if( 
g_bInServer && g_bAuthorized )
    {
        
eventAuthorizedAndPutInServer(id)
    }
}

public 
client_authorized(id)
{
    
g_bAuthorized true;
    if( 
g_bInServer && g_bAuthorized )
    {
        
eventAuthorizedAndPutInServer(id)
    }
}

eventAuthorizedAndPutInServer(id)
{
    
// Your code here

Regarding the order of plugin configuration files, plugins.ini will always load first.
__________________

Last edited by fysiks; 09-22-2022 at 22:54.
fysiks is offline
loki_himself
Member
Join Date: Nov 2021
Old 09-23-2022 , 05:57   Re: possible bug in admin flags when player times out?
Reply With Quote #7

thanks man, i was thinking too complicated
loki_himself is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 10-17-2022 , 10:19   Re: possible bug in admin flags when player times out?
Reply With Quote #8

@fysiks: Shouldn't the booleans be assigned to a player's id instead of globally?
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-17-2022 , 23:11   Re: possible bug in admin flags when player times out?
Reply With Quote #9

Quote:
Originally Posted by bibu View Post
@fysiks: Shouldn't the booleans be assigned to a player's id instead of globally?
Yes, both g_bInServer and g_bAuthorized should be arrays sized with 33 and indexed by id. Probably also need to make sure they get reset to false on client_disconnect() or something like that.
__________________
fysiks is offline
loki_himself
Member
Join Date: Nov 2021
Old 10-19-2022 , 15:24   Re: possible bug in admin flags when player times out?
Reply With Quote #10

yes of course they are arrays. i assume fysisks just quickly wrote it. which is all i needed, thanks again
loki_himself 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:25.


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