Jump to content
Sign in to follow this  
goldenfiver

Respawn tickers GUI- help needed

Recommended Posts

Hi guys, I'm trying to create a respawn tickets system. ( I've tried the vanilla one but it does not work the way I want). I need to find a way to let the players know how many tickets are left at any given time.

I want to create a small box displaying the number of tickets (parameter value). I will really appreciate any help since I don't know where to start (I read the guides and can create a basic GUI element).   

Share this post


Link to post
Share on other sites

Made some progress- this is what I have: 

This is the section in Description.ext : 

class RscTitles
{

class isrtg_respawn_tickets_hud
{

	idd = 23400;
	duration = 20000;
	onLoad = "execVM 'isrtg_scripts\respawn_tickets\isrtg_respawn_tickets_display.sqf';";
		class controlsBackground
		{
			class background_isrtg_respawns: RscPicture
			{
				idc = 5400;
				text = "isrtg_scripts\respawn_tickets\textures\respawn_background.paa";
				x = 61.9 * GUI_GRID_W + GUI_GRID_X;
				y = -5 * GUI_GRID_H + GUI_GRID_Y;
				w = 1.5 * GUI_GRID_W;
				h = 1 * GUI_GRID_H;
			};
		};
		class controls
		{
			class isrtg_respawn_tickets_display: RscText
			{
	
				idc = 23402;
				text = "15"; //--- ToDo: Localize;
				x = 61.9 * GUI_GRID_W + GUI_GRID_X;
				y = -5 * GUI_GRID_H + GUI_GRID_Y;
				w = 1.5 * GUI_GRID_W;
				h = 1 * GUI_GRID_H;
				font = EtelkaNarrowMediumPro;
				//colorBackground[] = {0, 0, 0, 1};
				//colorText[] = {0, 0, 1, 1};
				sizeEx = 0.03;
			};
		};
	};
};

I have no problem displaying this using cutRsc.  What I want to do now is to make 'isrtg_respawn_tickets_display' display the real parameter value of the tickets. I tried using another file to deal with this using the onLoad command. 

This is the file I made: 

		
		while {(str (findDisplay 23400)) != "no display"} do {
			ctrlSetText [23402, format["%1", west_tickets_number]];
		};

This works just fine when used with a normal dialog, but I can't get the same result using cutRsc. Can anyone tell me what I'm doing wrong?

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  

×