Jump to content
tachi

Zeus only for admins, need help.

Recommended Posts

Basically I want to create an addon, that allows any logged on admin to use full Zeus abilities, without manually placing any modules in redactor.

In redactor to do this all i need to do is:

Place Game master module with:

Owner:#adminLogged

In mission.sqm it looks like this:

class Item1
	{
		side="LOGIC";
		class Vehicles
		{
			items=1;
			class Item0
			{
				position[]={3792.4976,5,4174.27};
				azimut=0.1;
				class args
				{
					items=4;
					class Item0
					{
						value="#adminLogged";
						parentCls="ModuleCurator_F";
						typeName="Owner";
					};
					class Item1
					{
						value="Admin";
						parentCls="ModuleCurator_F";
						typeName="Name";
					};
					class Item2
					{
						value="3";
						parentCls="ModuleCurator_F";
						typeName="Addons";
					};
					class Item3
					{
						value="0";
						parentCls="ModuleCurator_F";
						typeName="Forced";
					};
				};
				id=1;
				side="LOGIC";
				vehicle="ModuleCurator_F";
				leader=1;
				lock="UNLOCKED";
				skill=0.60000002;
				text="bis_curator";
			};
		};
	};

So how do i make an addon that always spawns this module? Or maybe i can spawn this module via some function that i will insert in every mission?

Share this post


Link to post
Share on other sites

I'm afraid that for security reasons, the Game Master module cannot be spawned on the fly (a module object will appear, but without any functionality). Mission designer must place the module in the editor and configure its access, there's no other way.

Share this post


Link to post
Share on other sites
I'm afraid that for security reasons, the Game Master module cannot be spawned on the fly (a module object will appear, but without any functionality). Mission designer must place the module in the editor and configure its access, there's no other way.

Well, it's pretty sad.

Share this post


Link to post
Share on other sites

Wait what?

I've been creating curators on the fly for quite some time now and never had any problems with that. :butbut:

Not to mention that even if it wasn't possible it wouldn't really make a huge difference in terms of security. If someone gets far enough to be able to spawn a curator, then he can already do pretty much anything he likes. :d:

Share this post


Link to post
Share on other sites
Wait what?

I've been creating curators on the fly for quite some time now and never had any problems with that. :butbut:

Not to mention that even if it wasn't possible it wouldn't really make a huge difference in terms of security. If someone gets far enough to be able to spawn a curator, then he can already do pretty much anything he likes. :d:

Well, can you please tell me then how to spawn a GameMaster module with #adminLogged parametr?

Share this post


Link to post
Share on other sites

The #adminLogged parameter is exclusive to the module.

So if you don't place a module, that part has to be scripted.

Creating the curator itself merely requires the createVehicle command.

in its most basic form, it could look like this:

if (!isServer) exitWith { false };
_cur = "ModuleCurator_F" createVehicle [0,0,0];
_cur addCuratorAddons activatedAddons;
_someplayer assignCurator _cur;
 

The rest mostly depends on how exactly you want to implement it.

Making an addon with a PostInit function that runs only on the server and checks for admin-rights of players would probably work well:

https://community.bistudio.com/wiki/Functions_Library_(Arma_3)

It could also be made, so that everyone in a list of UIDs has access.

Share this post


Link to post
Share on other sites

Thanks for the answer. I'm pretty new in armas' scripting, where can i read how to get data if someone is admin and how to get his UID? And then how to assign curator abilities to someone with UID of loggedin admin?

I would really appreciate all the help :o

Edited by Tachi

Share this post


Link to post
Share on other sites
Thanks for the answer. I'm pretty new in armas' scripting, where can i read how to get data if someone is admin and how to get his UID? And then how to assign curator abilities to someone with UID of loggedin admin?

I would really appreciate all the help :o

TBH, most questions like that can be answered yourself by simply looking at the list of available commands:

https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3

Ctrl+F, search for "UID" and you've got a winner.

That command list is immensely useful.

Share this post


Link to post
Share on other sites

I want to edit my mission so that only admins have access to the Zeus role. Many of us beginner mission editors would like to know, in simple to understand terms and instructions, what exactly we must do to achieve that.

Is it really just as simple as making the Zeus Game Master module's owner #adminLogged? Would the admin then be able to assume the Zeus role just by hitting 'Y' key (the default key)?

This is the only thread I have found that even comes close to an answer. Tutorials seem to tell everything except how to do what most of us beginners want to know.

Share this post


Link to post
Share on other sites

Hello everyone, I dig up this old topic since it describes exactly what I want to do with the framework I want to develop. The framework will serve to develop missions more quickly to my team. It is not intended to be a larger community project. We will see later if the work realized is interesting I will share it ...
I would like the administrator to be the curator. I understand how to assign the curator but I miss a few steps to finalize.
Is there an event when a user logs in (#login) and logs out? Do you have another track to detect a user's authentication? Sorry if this subject has already been treated, I have not seen so far information after my research.

Share this post


Link to post
Share on other sites

Thank you for your response Tajin, more obviously it does not correspond to what I need. For example, I wish that when an admin connects via the #login command that it can receive the rights of curator, and when logout it should no longer be curator. This is what the module offers in 3den editor. But I wish our mission creators could do without this step and so I need to script the same behavior.

PS: I have an idea to get around the problem but it takes a step to the administration during the login. I would like to stay as simple as possible for our admins.

Share this post


Link to post
Share on other sites

Actually, this new command is better suited:

https://community.bistudio.com/wiki/admin

 

Anyhow, both of these commands allow you to do exactly what you need.

The fact that there is no eventhandler for the login just means you'll have to run a loop instead.

 

Another option would be to rebind the Zeus key ( https://community.bistudio.com/wiki/actionKeys -> actionKeys "curatorInterface" ) and run a script that checks for admin-rights when that key is pressed and then responds accordingly.

 

Or possibly even more elegant: You could use a combination of the "curatorPinged" and "curatorObjectRegistered" eventhandlers.
That should work very well, since the ping only happens when someone is not assigned as Zeus yet.

  • Like 1

Share this post


Link to post
Share on other sites

Perfect. I really like the solution used with the CuratorPinged. On the other hand, I'm not sure about understanding the combination with CuratorObjectRegistered. I propose you the following pseudo code, if you can tell me whether this is suitable or not.

 

EVENT CuratorPinged -> IF ADMIN ASSIGN PLAYER AS CURATOR
EVENT CuratorObjectRegistered -> IF NOT ADMIN UNASSIGN PLAYER AS CURATOR.

 

Correct?

 

If so, what will happen to the camera? Can it be restored?

Share this post


Link to post
Share on other sites

Exactly. I don't think the camera will be an issue.

  • Like 1

Share this post


Link to post
Share on other sites

Perfect, I think test this tonight. Thank you so much for your help. I'm sure that this solution must be correct so I will not give any news about this thread. No news = good news;). Goodbye :f:

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

×