Instead of opening the .menu-files directly, add a scriptMenuResponse and handle the response in your menus.gsc with the guid-check.
for debugging, just print menu and response after this line:
Code:
self waittill("menuresponse", menu, response);
this is your current guid-check:
Code:
if( isSubStr( self getGuid(), getCvar( "scr_admin_guid0" ) ) )
self thread guid_succes();
if( isSubStr( self getGuid(), getCvar( "scr_admin_guid1" ) ) )
self thread guid_succes();
if( isSubStr( self getGuid(), getCvar( "scr_admin_guid2" ) ) )
self thread guid_succes();
if( isSubStr( self getGuid(), getCvar( "scr_admin_guid3" ) ) )
self thread guid_succes();
if( isSubStr( self getGuid(), getCvar( "scr_admin_guid4" ) ) )
self thread guid_succes();
if( isSubStr( self getGuid(), getCvar( "scr_admin_guid5" ) ) )
self thread guid_succes();
if( isSubStr( self getGuid(), getCvar( "scr_admin_guid6" ) ) )
self thread guid_succes();
if( isSubStr( self getGuid(), getCvar( "scr_admin_guid7" ) ) )
self thread guid_succes();
if( isSubStr( self getGuid(), getCvar( "scr_admin_guid8" ) ) )
self thread guid_succes();
if( isSubStr( self getGuid(), getCvar( "scr_admin_guid9" ) ) )
self thread guid_succes();
the better way is to embed the guid directly into the cvar like:
- scr_admin_132143
- scr_admin_534534
- scr_admin_252735
then you can check in ONE line all possible admins like:
Code:
guid = player getGuid();
if (getcvar("svr_admin_" + guid) == "1")
{
// is admin...
}