Jump to content
Sign in to follow this  
alleycat

remoteExec - filter for admin clients?

Recommended Posts

I would like to send debug messages from the server that only a logged in admin player can see.

 

https://community.bistudio.com/wiki/remoteExecis useful for sending messages, but I have not found an elegant way to filter for admin clients on the server side. I think I could have the server force a client to runa script on the client which then filters for admins, but that seems not smooth. I would like to filter out whether a player is an admin on the server

 

 

Share this post


Link to post
Share on other sites

I use a list of admin player uids, then iterate over the allplayers array + the owner command.

 

admin_list_array = ['9999999999999'];
_messagelist = [];
{
     if ((getplayeruid _x) in admin_list_array) then {
          0 = _messagelist pushback (owner _x);
     };
} count allplayers;
if (!(_messagelist isequalto [])) then {
     'message to admins' remoteexec ['systemchat',_messagelist,false];
};

Share this post


Link to post
Share on other sites

Also, you may exec to everyone a function with the message, and on the begining of the function:

 

if (not(serverCommandAvailable "#logout")) exitWith {};

  • Like 1

Share this post


Link to post
Share on other sites

 

I use a list of admin player uids, then iterate over the allplayers array + the owner command.

admin_list_array = ['9999999999999'];
_messagelist = [];
{
     if ((getplayeruid _x) in admin_list_array) then {
          0 = _messagelist pushback (owner _x);
     };
} count allplayers;
if (!(_messagelist isequalto [])) then {
     'message to admins' remoteexec ['systemchat',_messagelist,false];
};

remote exec accepts object for target as well as owner id

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  

×