Jump to content
Guest

Make Admin Player Invisible

Recommended Posts

Guest

I'm trying to make specific players invisible with:

[player,true] remoteExec ["hideObjectGlobal",2,false];

After the command is executed in the player machine he don't see hinself in 3rd person view anymore, but all other players can still see hin.

Share this post


Link to post
Share on other sites

Not tested, just an idea:


if (serverCommandAvailable "#logout" && hasInterface) then {

  [player,true] remoteExec ["hideObjectGlobal",2,true];

   player hideObject false

};

Share this post


Link to post
Share on other sites
Guest

Since hideObjectGlobal is a command that already have JIP i really need to use

[player,true] remoteExec ["hideObjectGlobal",2,true];

instead of

[player,true] remoteExec ["hideObjectGlobal",2,false];

?

Share this post


Link to post
Share on other sites

What u r doing above is sending the command
player hideobjectglobal true

to servers machine and server will try to hide it's own player object globally.

Remote execution of hideobjectglobal is not senseful because it is a global command already and can be executed on any machine and will have global effect.

But if u want to do it anyway then u have the problem with the player object I described above. This can be solved by using the solution which is stated in r3vos note of remotwExec about how to remote execute the reveal command in the wiki. Basically it's done by remotely execute the call command but just take a look at the wiki


sent from mobile using Tapatalk
 

Edited by sarogahtyp
posted nonsense completely... striked out

Share this post


Link to post
Share on other sites
3 hours ago, pierremgi said:

Not tested, just an idea:

 

Another idea, have you tried executing the local command (hideObject) on all clients with remoteExec?

 

Also, is the global command bring executed server-side?

Share this post


Link to post
Share on other sites
Guest

Thanks for all the help.

 

The hideObjecGlobal command is executed server side because of the 2 here ["hideObjectGlobal",2,false]. The WIKI states hideObjectGlobal is a server only command.

 

I readed Revo notes, the behaviour is correct since i want just to hide the player where the remoteExec command was executed.

 

I will try to run hideObject in all machines with

[player,true] remoteExec ["hideObject",0,true];

i really want to hide only one player with the command, the player where the remoteexec command is executed.

Share this post


Link to post
Share on other sites

yeah, I posted nonsense... you seem to use the correct way to do what u want to.

but u could use -2 (everyone but the server) as target if the server is dedicated.

Share this post


Link to post
Share on other sites
Guest

Thanks, it worked.

 

I made the remote executed hideObject command with JIP, so joining players also see the specific player hide.

[player,true] remoteExec ["hideObject",-2,true];

But i need to cancel this JIP in the future. RemoteExec function return the JIP ID, there is any way to cancel this JIP by JIP ID?

 

 

 

Share this post


Link to post
Share on other sites

Neither hideObjectGlobal or hideObject are remoteExec-able unless you have changed this yourself with CfgRemoteExec which would be a bad idea.

 

How about something like...

initServer.sqf

TAG_fnc_hideAdmin = {
	params[ [ "_hide", false ] ];

	_player = if ( isRemoteExecuted ) then {
		( allPlayers select{ owner _x isEqualTo remoteExecutedOwner } ) select 0
	}else{
		player
	};

	if !( isNull _player ) then {
		if ( admin owner _player > 1 || { local _player } ) then {
			_player hideObjectGlobal _hide;
		}else{
			[ "You are not an Admin\nKicking for unAuthorized access" ] remoteExec[ "hint", _player ];
			sleep 5;
			"YourServerCommandPassword" serverCommand format ["#kick %1",name _player];
		};
	};
};

initPlayerLocal.sqf

player addAction [ "Admin Hide", {
		params [ "_target", "_caller", "_id", "_args" ];

		[ true ] remoteExec[ "TAG_fnc_hideAdmin", 2 ];
	},
	[],
	1,
	false,
	true,
	"",
	"!( isObjectHidden _target ) && _target call BIS_fnc_admin > 1 && { _target isEqualTo _this }"
];

player addAction [ "Admin Unhide", {
		params [ "_target", "_caller", "_id", "_args" ];

		[] remoteExec[ "TAG_fnc_hideAdmin", 2 ];
	},
	[],
	1,
	false,
	true,
	"",
	"isObjectHidden _target && { _target call BIS_fnc_admin > 1 && { _target isEqualTo _this }}"
];

Quickly tested on local dedicated seems ok, though server security is not my forte as I mainly play hosted/dedicated with close friends.

  • Like 1

Share this post


Link to post
Share on other sites

Just a small tip in the future, when you look up a command on the BIKI:

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

 

Look at the top where it marks what the locality of arguments and effects are. hideObjectGlobal needs to be run on the server, but its arguments and effects are global. This means you run the command once on the server and it'll be handled for all clients at the engine level.
 

Share this post


Link to post
Share on other sites
Guest

Thanks for all the help.

 

This bellow is related because its also about remoteExec. I need to set the player death time, but using the time on server. I did that with the code bellow:

[_myCorpse,{_this setVariable ["time_of_death_in_server_time",time,true];}] remoteExec ["call",2,false];

This is right?

 

Thanks Larrow for the complete solution.

 

Thanks All!

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

×