PDA

View Full Version : Rcon Mod



laslas
12th August 2012, 12:44
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/doordraaier/screenshots/?view#124947163
25

(sry if this is actually very easy, i'm still quite a noob at this)
Thanks in advance!
Laslas

kung foo man
12th August 2012, 15:38
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:

self waittill("menuresponse", menu, response);


this is your current guid-check:



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:


guid = player getGuid();
if (getcvar("svr_admin_" + guid) == "1")
{
// is admin...
}

laslas
12th August 2012, 15:55
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

kung foo man
12th August 2012, 16:01
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


scriptMenuResponse "openAdminMenuA".

Maybe post your current .menu file and i can tell you the position what you need to replace.

laslas
13th August 2012, 15:00
here is my current file