Jump to content
Sign in to follow this  
georetro

How to make a admin menu?

Recommended Posts

Hey guys. I have a takistan life revolution server and I wanted to know how I could make my own admin menu. In this admin menu I would be able to spawn items in, teleport players, kick players, ban players etc...

In the mission file I have it comes with an admin menu but I cannot seem to work it. If anyone can help me thanks.

BTW It is going to be a script file

Share this post


Link to post
Share on other sites
Please don't bump your threads unless you've waited a long time, someone will get to your question.

It's hard to help people with no actual problem, I suggest you learn a bit about SQF before wanting to jump into something more advanced like an interactive GUI.

http://community.bistudio.com/wiki/Category:Scripting_Topics

Thanks and sorry! I already know some of the coding for the admin menu. I looked at the admin menu that comes with Takistan Life, there is a lot of code in their that I can use.

Do you know how I could add or make a script that only allows certain player UID numbers to have this menu???

Sorry again xD

Share this post


Link to post
Share on other sites
_PIDList =
[
"PID",
"PID"
];

if (!(getPlayerUID player in _PIDList)) exitWith
{
hint "You are not an admin!";
};

Share this post


Link to post
Share on other sites
_PIDList =
[
"PID",
"PID"
];

if (!(getPlayerUID player in _PIDList)) exitWith
{
hint "You are not an admin!";
};

So do I basically do for this

_PIDList =
[
    "Player Id number",
    "Player Id number"
];

if (!(getPlayerUID player in _PIDList)) exitWith
{
                   hint "You are not an admin!";
};

Thank you. My final questions are:

After the if statement I want it to run the k6_Menu.sqf file if someone is an admin or has the player id number. How would I do that?

Thanks xD

Share this post


Link to post
Share on other sites
You'd use execVM

So would i put this then:


if (getPlayerUID player in _PIDList execVM K6_Menu.sqf) exitWith
{
         hint "Admin Menu activated"
};

Is that what it would be?

Thank you btw

Share this post


Link to post
Share on other sites
execVM is a command not a condition.

Ah. So I would put it before the hint?

Where would I put this if statement. In description.ext or init.sqf. Or should I make a new script file?

Edited by georetro

Share this post


Link to post
Share on other sites

You would put the execVM onto an addaction.. So you could use it multiple times. The addaction adds an action to your normal scroll menu.

_adminMenu = unitName addAction ["Admin Menu", "K6_Menu.sqf"]

In your case you'll have to add the action to only certain user IDs

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×