Jump to content

[Tutorial] Status Bar 4.4r3


Recommended Posts

On 25/12/2016 at 7:50 PM, Kaiman™ * Publiclir.se said:

Hi. you can do so you can see how hungry and if you need water and if you are injured to this? And is it possible to make it more center so it is like in the middle of the screen

 

Can i do like this would it work?

 

sleep 1;
		_counter = _counter - 1;
		((uiNamespace getVariable "osefStatusBar")displayCtrl 1000)ctrlSetText format[" FPS: %1 | Police: %2 | Civilians: %3 | EMS: %4 | CASH: %5 | BANK: %6 | GRIDREF: %7 | health: %8 | hungry: %9 | water: %10", round diag_fps, west countSide playableUnits, civilian countSide playableUnits, independent countSide playableUnits,[life_cash] call life_fnc_numberText,[life_atmbank] call life_fnc_numberText,mapGridPosition player, _counter];

 

Dude do you got ways to put hungry, thirst and damage on this stats bar?

Link to post
Share on other sites
  • Replies 86
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Difficulty: Eas

People in this thread have cancer and they did not read what happened to the forums

Author Name:  Dart_Rogue For people who want icons Here. Just replace it with the one you got.  /* Player Status Bar with Icons v 1.36 Author: Dart_Rogue Mod: Epoch https://github.com/DarthRo

Posted Images

10 hours ago, mikebrloco said:

Dude do you got ways to put hungry, thirst and damage on this stats bar?

It is not hard at all.

use your brain a little bit and see how the vanilla HUD does it? It was also mentioned an attempt in this thread if you looked....

Link to post
Share on other sites
48 minutes ago, Deadlesszombie said:

It is not hard at all.

use your brain a little bit and see how the vanilla HUD does it? It was also mentioned an attempt in this thread if you looked....

But I want to close the health on this bar and remove my hud, and my hud have another variatons like LIFE_BAR_WATER_RING

Link to post
Share on other sites
32 minutes ago, mikebrloco said:

But I want to close the health on this bar and remove my hud, and my hud have another variatons like LIFE_BAR_WATER_RING

I said vanilla, look at how other people attempted it, it is very easy to get the number of health or thirst someone is at... there are plenty of other huds that find the amount as well as the VANILLA files

 

if you copy paste you won't learn and your server won't be better than anyone elses

Edited by Deadlesszombie
Link to post
Share on other sites
  • 1 year later...
On 9/13/2016 at 2:14 AM, suffer4real said:

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Difficulty: Easy

Publish by:  suffer4real

Source AltisLifeRPG.com cache

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Here is a tutorial on how to add a status bar to your server!

Location of changes: Mission.Map (Eg. AltisLife.Altis or TanoaLife.Tanoa)

Difficulty: Easy

Author: Osef (Supposedly)
Edited by: midgetgrimm

Changes and improvements: Breau

Source : Altisliferpg.com (cache recovery)

_____________________________________________________________________________________________________________________________________

1. Navigate to your core folder in your root directory and create a folder called scripts.

2. Inside the new scripts folder create a file called fn_statusBar.sqf and inside paste the following:

waitUntil {!(isNull (findDisplay 46))};
disableSerialization;
/*
	File: fn_statusBar.sqf
	Author: Some French Guy named Osef I presume, given the variable on the status bar
	Edited by: [midgetgrimm]
	Description: Puts a small bar in the bottom right of screen to display in-game information

*/
4 cutRsc ["osefStatusBar","PLAIN"];

[] spawn {
	sleep 5;
	_counter = 180;
	_timeSinceLastUpdate = 0;
	while {true} do
	{
		sleep 1;
		_counter = _counter - 1;
		((uiNamespace getVariable "osefStatusBar")displayCtrl 1000)ctrlSetText format[" FPS: %1 | Police: %2 | Civilians: %3 | EMS: %4 | CASH: %5 | BANK: %6 | GRIDREF: %7 ", round diag_fps, west countSide playableUnits, civilian countSide playableUnits, independent countSide playableUnits,[life_cash] call life_fnc_numberText,[life_atmbank] call life_fnc_numberText,mapGridPosition player, _counter];
	};
};

3. Navigate back to your mission's root and enter the dialog folder, once in there create a file called statusBar.hpp and paste inside the following:

#define ST_RIGHT 0x01

class osefStatusBar {
	idd = -1;
	onLoad = "uiNamespace setVariable ['osefStatusBar', _this select 0]";
	onUnload = "uiNamespace setVariable ['osefStatusBar', objNull]";
	onDestroy = "uiNamespace setVariable ['osefStatusBar', objNull]";
	fadein = 0;
	fadeout = 0;
	duration = 10e10;
	movingEnable = 0;
	controlsBackground[] = {};
	objects[] = {};
	class controls {
		class statusBarText {
			idc = 1000;
			x = safezoneX + safezoneW - 1;
			y = safezoneY + safezoneH - 0.08;
			w = 1;
			h = 0.03;
			shadow = 1;
			colorBackground[] = { 1, 0.3, 0, 0.0 };  // uncomment and increase 4th number to have a background
			font = "PuristaSemibold";
			size = 0.035;
			type = 13;
			style = 1;
			text="Loading server info...";
			class Attributes {
				align="right";
				color = "#FFFFF";
			};
		};
	};
};

4. Go back to your mission's root directory and open init.sqf and add the following:

[] execVM "core\scripts\fn_statusBar.sqf";

4.5 It should look something like this: 

[] execVM "briefing.sqf"; //Load Briefing
[] execVM "KRON_Strings.sqf";
[] execVM "core\scripts\fn_statusBar.sqf";

5. Navigate back to your mission's root directory and open up description.ext and add the following underneath class RscTitles

#include "dialog\statusBar.hpp"

5.5 It should now look something like this: 

class RscTitles {
	#include "dialog\progress.hpp"
	#include "dialog\hud_nameTags.hpp"
	#include "dialog\hud_stats.hpp"
	#include "dialog\statusBar.hpp"
};

6. You have now completed the installation, repack your mission and restart your server.

I can't spawn why ?

Edited by Pootzen152
Link to post
Share on other sites
6 minutes ago, Pootzen152 said:

Error in expression <lockpick; closeDialog 0; }; case (EQUAL(_item,"marijuana")): { if(([false,_item> Error position: <(_item,"marijuana")): { if(([false,_item> Error Missing ) File core\pmenu\fn_useItem.sqf [life_fnc_useItem]..., line 135

 

everything is here.... you forgot a ")" or you added a "(" that is not closed and not necessary.

Link to post
Share on other sites
6 minutes ago, Nirawiin said:

Error in expression <lockpick; closeDialog 0; }; case (EQUAL(_item,"marijuana")): { if(([false,_item> Error position: <(_item,"marijuana")): { if(([false,_item> Error Missing ) File core\pmenu\fn_useItem.sqf [life_fnc_useItem]..., line 135

 

everything is here.... you forgot a ")" or you added a "(" that is not closed and not necessary.

thank you i'll try

Link to post
Share on other sites
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.