AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED] remove_user_flags not working (https://forums.alliedmods.net/showthread.php?t=215902)

Blizzard_87 05-13-2013 18:35

[SOLVED] remove_user_flags not working
 
im testing some new things on my LAN server... and

remove_user_flags( index ) is not working..

its set to remove all flags on client_connect( id ).

but once i connect and spawn i still have all my flags still...

Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "Activate Admin" #define VERSION "1.0" #define AUTHOR "Blizzard" new szFlags[ 33 ]; public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_concmd( "test", "test", 0, ": test <password>" ); } public client_connect( id ) {     szFlags[ id ] = get_user_flags( id );     remove_user_flags( id ); } public test( id ) {     new iArg[ 32 ];     read_argv( 1, iArg, charsmax( iArg ) );         if( equal( iArg, "password" ) )     {         set_user_flags( id, read_flags( szFlags[ id ] ) );         return PLUGIN_HANDLED;     }     else if( !equal( iArg, "password" ) )     {         console_print( id, "Usage: test <password>" );     }     return PLUGIN_HANDLED; }

Bugsy 05-13-2013 18:41

Re: remove_user_flags not working
 
I don't think the player has flags yet at connect, try putinserver.

Blizzard_87 05-13-2013 18:58

Re: remove_user_flags not working
 
Quote:

Originally Posted by Bugsy (Post 1951469)
I don't think the player has flags yet at connect, try putinserver.

that did it thanks.

im at work and not thinking straight im stupid lol

Jhob94 05-13-2013 20:58

Re: [SOLVED] remove_user_flags not working
 
At putinserver maybe not read yet (It depends not always samet time). Make a task with 10seconds on putinserver for make sure it gonna work ;)

Blizzard_87 05-13-2013 21:14

Re: [SOLVED] remove_user_flags not working
 
Quote:

Originally Posted by Blizzard_87 (Post 1951485)
that did it thanks.

im at work and not thinking straight im stupid lol

Quote:

Originally Posted by Jhob94 (Post 1951535)
At putinserver maybe not read yet (It depends not always samet time). Make a task with 10seconds on putinserver for make sure it gonna work ;)

client_putinserver forward worked... Jhob94 :wink:

fysiks 05-14-2013 03:58

Re: [SOLVED] remove_user_flags not working
 
Flags are set in client_authorized which is one function that you never know when it will execute. Therefore, you should use client_authorized.


All times are GMT -4. The time now is 16:25.

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