-
1 Attachment(s)
Rcon Mod
Hey guys!
I'm currently making a rcon mod (in the quick message menu) , and it's evolving pretty well.
But i'm stuck at one thing, so i hope someone can help me.
here it is:
I don't want ppl to see the admin section (ofcourse they can't use it, but they can still see it)
Here's a pic of the mod (you can also see the _menus.gsc as an attachement)
http://it.xfire.com/profile/doordraa...view#124947163
Attachment 25
(sry if this is actually very easy, i'm still quite a noob at this)
Thanks in advance!
Laslas
-
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...
}
-
Thank you for the quick reply! :D
but as i already posted i'm quite a noob at this, so i really don't know what you mean with the first step.
I mean where do i have to put that line?
Laslas
-
the scriptMenuResponse belongs in your .menu-files. you need to replace the openMenu statement in your "master" .menu-file and replace it with the scriptMenuResponse-statement like
Code:
scriptMenuResponse "openAdminMenuA"
.
Maybe post your current .menu file and i can tell you the position what you need to replace.
-
1 Attachment(s)