I finally got some time to continue on the mod, but I couldn't get your way to work, so I am trying to it in DemonSeed's way.
I make a new thread
Code:
test1()
{
level.admin_guids = StrTok( getCvar( "scr_admin_guids" ), "_" );
if( isSubStr( self getGuid(), level.admin_guids ) )
self setClientCvar( "ui_allow_rcon", "1" );
if( !isSubStr( self getGuid(), level.admin_guids ) )
self setClientCvar( "ui_allow_rcon", "0" );
return;
}
Then I modify the "OnPlayerConnect" thread, so it starts the test1 thread.
The problem with this, is that
it wont log you in and when I try to use it with level.admin_guids it wont display the admin section, even with the GUID being the correct one, and you can still open the menus :s
Then I made it in another way, by using scr_admin_guids
Code:
test1()
{
if( isSubStr( self getGuid(), getCvar( "scr_admin_guids" ) ) )
self setClientCvar( "ui_allow_rcon", "1" );
}
test2()
{
if( !isSubStr( self getGuid(), getCvar( "scr_admin_guids" ) ) )
self setClientCvar( "ui_allow_rcon", "0" );
return;
}
This code works, but you can only have 1 GUID in it, and
you can still open the menu even if you have a wrong GUID.
I also added a button where it re-threads the GUID control if pressed - so you wont have to reconnect to see if it works, but that works fine.