Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • Need help?

    Create a topic in the appropriate section
    Don't write everything in the chat!
  • Take a look at the marketplace

    There you can buy
    everything related to game servers
  • Don't want a ban?

    Please read our rules
    Don't disturb the order!
  • Sell or buy?

    Use services of the guarantor
    We will make your deal safe

Recommended Posts

Привет.
Сейчас я расскажу как добавить статус бар на сервер ARMA 3 Altis Life.

Он включает в себя:

  • количество гражданских игроков;
  • количество полицейских;
  • количество медиков;
  • координаты;
  • наличные деньги;
  • деньги в банке;
  • FPS.

1. Создаем файл "statusBar.sqf".

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], Maksim

Description: Puts a small bar in the bottom right of screen to display in-game information



*/

4 cutRsc ["osefStatusBar","PLAIN"]; 
//systemChat format["Загрузка информации...", _rscLayer];

[] spawn {
	sleep 5;
	_counter = 180;
	_timeSinceLastUpdate = 0;
	while {true} do
	{
		sleep 1;
		_counter = _counter - 1;
		((uiNamespace getVariable "osefStatusBar")displayCtrl 1000)ctrlSetText
    format["FPS: %1 | Копы: %2 | Граждане: %3 | Медики: %4 | Наличные: %5 | Банк: %6 | Координаты: %7", round diag_fps, west countSide playableUnits, civilian countSide playableUnits, independent countSide playableUnits,[life_cash] call life_fnc_numberText,[life_atmcash] call life_fnc_numberText,mapGridPosition player, _counter];
	}; 
};

2. Создаем файл "statusBar.hpp".

#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 - 2.65;
			y = safezoneY + safezoneH - 0.04;
			w = 1;
			h = 0.04;
			shadow = 2;
			colorBackground[] = { 1, 0.3, 0, 0.0 };
			font = "PuristaSemibold";
			size = 0.03;
			type = 13;
			style = 1;
			text="Загрузка информации...";
			class Attributes {
				align="right";
				color = "#009999";
			};
		};
	};
};

3. Открываем файл "description.ext" и ищем в нем "class RscTitles". Затем добавляем в него наш  "statusBar.hpp".

Должно получиться примерно так:

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

4. Открываем файл "init.sqf" и подключаем наш скрипт:

[] execVM "statusBar.sqf";

Готово.

 

Ссылка на оригинал: http://www.altisliferpg.com/topic/10170-advanced-statusbar/

Share this post


Link to post
Share on other sites



Подскажите пожалуйста, возможно ли заменить текст на иконки раа? Если да, то как прописать? Даже не сомневаюсь что можно, но как сделать, не знаю))

Share this post


Link to post
Share on other sites

Подскажите пожалуйста, возможно ли заменить текст на иконки раа? Если да, то как прописать? Даже не сомневаюсь что можно, но как сделать, не знаю))

format["

            <t shadow='1' shadowColor='#000000' color='%10'><img size='1.6' shadowColor='#000000' image='addons\statusbar\icons\players.paa' color='%6'/> %2</t>

 

В общем походу я сам ответ нашел. Буду пробовать.

Share this post


Link to post
Share on other sites

Тут есть ошибка?

#include "dialog\ui.hpp" 

Где его взять если его нету?

 

Edited by Sauta (see edit history)

Share this post


Link to post
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

  • Similar Content

    • By ro1and
      Помогите найти статус бар. Видел его на нескольких серверах, но ни здесь, ни на exilemod.com найти не получилось)
      Скриншот конечно так себе, но на данный момент лучше не могу найти.
      Заранее спасибо.
    • By DrTauren
      Собственно, некоторым не нравится стандартный Statusbar, кому-то он не нужен, а кто-то хочет установить свой statusbar, для этого вам пригодится данная статья. Итак, как убрать стандартный statusbar в Altis Life:

      1) Открываем description.ext и комментируем, либо удаляем эту строку:
      #include "dialog\hud_stats.hpp" то есть должно получиться так (если кто не понял ):
       

      2) Открываем файл core\functions\fn_hudSetup.sqf и комментируем эти строки:
      disableSerialization; cutRsc ["playerHUD", "PLAIN", 2, false]; [] call life_fnc_hudUpdate; [] spawn {     private["_dam"];     for "_i" from 0 to 1 step 0 do {         _dam = damage player;         waitUntil {(damage player) != _dam};         [] call life_fnc_hudUpdate;     }; }; Результат:

      3) Открываем файл core\functions\fn_hudUpdate.sqf и комментируем эти строки:
      disableSerialization; if (isNull LIFEdisplay) then {[] call life_fnc_hudSetup;}; LIFEctrl(2200) progressSetPosition (life_hunger / 100); LIFEctrl(2201) progressSetPosition (1 - (damage player)); LIFEctrl(2202) progressSetPosition (life_thirst / 100); Примеры того как это должно выглядеть есть выше, не буду повторяться. 
      Вот собственно и всё 
    • By Zloy
      Привет всем! Сегодня установил на сервер statusBar. Сервер работает, но строка сама не отображается на экране.
      Делал по гайду: http://epochmod.ru/forum/index.php?/topic/274-dobavlenie-stroki-statusbar/ 
      и по этому делал: http://dayzepoch.com/forum/index.php?/topic/30284-status-bar/ , но всё равно не работает строка.  Помогите устранить!  
  • Our picks

×
×
  • Create New...

Important Information

By using this site, you automaticly agree to our Guidelines and Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.