Results 1 to 5 of 5

Thread: Rcon Mod

  1. #1
    ... connecting
    Join Date
    Aug 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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
    _menus.gsc.txt

    (sry if this is actually very easy, i'm still quite a noob at this)
    Thanks in advance!
    Laslas
    Last edited by laslas; 12th August 2012 at 11:47. Reason: wrong attachement

  2. #2
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    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...
    }

  3. #3
    ... connecting
    Join Date
    Aug 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you for the quick reply!
    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

  4. #4
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    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.

  5. #5
    ... connecting
    Join Date
    Aug 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    here is my current file
    Attached Files Attached Files
    Last edited by laslas; 13th August 2012 at 14:03.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •