Jump to content
  • 0

Server sided uid list


zeppo

Question

1 answer to this question

Recommended Posts

  • 0
On 24/01/2016 at 2:52 PM, zeppo said:

How can i make a server sided uid list to this command?

If !(getPlayerUID) player in Admin) then {

sorry for the delay in replying to you.

here is the way I do it - this below is from a working script, so it definitely works.

 

A. in server-side settings/configuration file, you define the players, like this:

//====================
// Total Omniscience pUIDs Array
// use SteamID64 here
mgmTfA_configgv_totalOmniscienceGroupTextStringArray	=	[
								"76561198070011111"					,
								"76561198070022222"					,
								"76561198070033333"					,
								"76561198070044444"					,
								"76561198070055555"					,
								"76561198070066666"					// no comma on last entry!
								];

//====================

the above is NOT visible to clients yet.

 

B. next, in server-side settings/configuration file, you advertise these values so all connecting clients can "see it", like this:

//====================
// TotalOmniscience Group PUIDs Database:	a single dimensional array containing PUIDs. See masterConfig for details.
// (contents come from masterConfig - we just publicVariable broadcast it so that clients can access to it & compare their PUID values after Drop Off point)
publicVariable "mgmTfA_configgv_totalOmniscienceGroupTextStringArray";
if (mgmTfA_configgv_serverVerbosityLevel>=5) then {diag_log format ["[mgmTfA] [mgmTfA_scr_server_initServer.sqf]          PublicVariable BROADCASTED:  mgmTfA_configgv_totalOmniscienceGroupTextStringArray is: (%1)", (str mgmTfA_configgv_totalOmniscienceGroupTextStringArray)];};
//====================

 

C. then in your client-side script, you traverse the array using a loop, like this:

//====================
scopeName "mgmTfA_gvdb_PV_GUSUIDNumberMainScope";
_totalOmniscienceGroupMatchFound = false;
private ["_uid"];
_uid = (getPlayerUID player);
{
	// compare my PUID with the current PUID in array. 
	//	if current entry does not match, proceed with the next one
	//	if current entry does match, issue "_yesIShouldTrackThisSU = true"; 	and breakTo mgmTfA_gvdb_PV_GUSUIDNumberMainScope
	//	if no entries match, end routine, as there is nothing to be done
	if (_uid == _x) then {
		if (mgmTfA_configgv_clientVerbosityLevel>=4) then {diag_log format ["[mgmTfA] [mgmTfA_scr_client_initRegisterClientEventHandlers.sqf] [TV4] totalOmniscienceGroup match found - local computer is to track!"];};//dbg
		_totalOmniscienceGroupMatchFound = true;
		breakOut "totalOmniscienceGroupTraverseScope";
	} else {
		diag_log format ["[mgmTfA] [mgmTfA_scr_client_initRegisterClientEventHandlers.sqf]  [DEV-DEBUG]           No luck in totalOmniscienceGroup in this iteration..."];//dbg
	};
} forEach mgmTfA_configgv_totalOmniscienceGroupTextStringArray;
//diag_log format ["[mgmTfA] [mgmTfA_scr_client_initRegisterClientEventHandlers.sqf]  [DEV-DEBUG]           Just under forEach now. The value for _totalOmniscienceGroupMatchFound is: (%1).", (str _totalOmniscienceGroupMatchFound)];
//====================

 

there are code bits that you do not need, feel free to remove them.
in-line comments are from actual code and not for you so simply ignore them.

 

hope this helps.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...