DY357LX

[QUESTION] Custom Flags - Limiting Them By UID - Code Check

26 posts in this topic

We've got custom flags in, now we're attempting to so only certain players can use their custom flags.

Would this work?

class CfgFlags 
{
	class USA
	{
		name = "USA";
		texture = "\A3\Data_F\Flags\flag_us_co.paa";
		uid = "";
	};
	if ((getPlayerUID player) in ["PLAYERUIDHERE"]) then
	{
		class CUSTOMFLAG1
		{
			name = "CUSTOMFLAG1";
			texture = "custom\flags\CUSTOMFLAG1.paa";
			uid = "";
		};
	};
};

Or will the lack of "else" statement break things?

Thanks.

Share this post


Link to post
Share on other sites

No, that most likely will not work.  That file is a .CPP and not a .SQF, meaning they have entirely different syntax.  You would need to edit the function where the list is populated for players to only show those that are allowed for them.  Sounds way more simplistic than it really is I think. 

Share this post


Link to post
Share on other sites
Advertisement

mhh try this?
 

class USA
	{
		name = "USA";
		texture = "\A3\Data_F\Flags\flag_us_co.paa";
		uid = "YOURUIDHERE?";
	};

 

Edited by Warsheep

Share this post


Link to post
Share on other sites

@Warsheep - Would that work? Is it really that simple?

For multiple UID's would this be the correct format:
 

uid[] = {"CUSTOMUID1","CUSTOMUID2"};

 

Share this post


Link to post
Share on other sites

Grim had made a post on this in the old forums do it like i have it here and just make new entries and make sure they point to the right file and its as simple as that, but this is in the exile.altis config.cpp so the images need to be in there also so unless you make small files it can get pretty big.

class CfgFlags 
{
	class USA
	{
		name = "USA";
		texture = "\A3\Data_F\Flags\flag_us_co.paa";
		uid = "PLACE UID HERE";
	};
};

Share this post


Link to post
Share on other sites

Yeah I've got 2 custom flags in and working already. I just need to limit them to the right owners/players to stop them moaning :)

Any idea if my array code will work for multiple UIDs?

Share this post


Link to post
Share on other sites

Grim had made a post on this in the old forums do it like i have it here and just make new entries and make sure they point to the right file and its as simple as that, but this is in the exile.altis config.cpp so the images need to be in there also so unless you make small files it can get pretty big.

class CfgFlags 
{
	class USA
	{
		name = "USA";
		texture = "\A3\Data_F\Flags\flag_us_co.paa";
		uid = "PLACE UID HERE";
	};
};

Work this now with uids[] = {"id","id"};  ??

Share this post


Link to post
Share on other sites

Like this

prof: this file exileclient_gui_setupterritorydialog_show.sqf <---

class DK
{
	name = "Denmark";
	texture = "IAT\texture\flag_dk.paa";
	uids[] = {};
};
class DKPRIAVTE
{
	name = "DenmarkPriv";
	texture = "IAT\texture\flag_dk.paa";
	uids[] = {"ID1","ID2"};
};

 

Edited by itsatrap
1 person likes this

Share this post


Link to post
Share on other sites
Advertisement

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

  • Recently Browsing   0 members

    No registered users viewing this page.