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
  • 0
JIIEKA

Помогите с player_updateGui.sqf

Помогите пожалуйста переделать player_updateGui.sqf
дело в том что когда я вот эти строки разкоментирую
 

 

//_ctrlCash =_display displayCtrl 1429;
//_ctrlBank =_display displayCtrl 1431;


//_cashMoney         = _thePlayer getVariable["cashMoney",0];
//_bankMoney         = _thePlayer getVariable["bankMoney",0];
//_cash=[_cashMoney] call BIS_fnc_numberText;//3
//_balance=[_bankMoney] call BIS_fnc_numberText;


//_ctrlCash= ctrlSetText str(player getVariable["cashMoney",0]);
//_ctrlBank= ctrlSetText str(player getVariable["bankMoney",0]);
 

 

 
Включаю сервер и иконки глючат. показывает все по 1000, ноги сломаны, хуманити тоже 1000 и монет тоже 1000. в банке тоже 1000.
дело в том что у меня Банковская система основана на headShots - ах 
 
помогите пожалуйста переделать player_updateGui.sqf для моей банковской системы
 
 
 

 

private ["_display","_ctrlBlood","_pOn","_wpui","_rplayeruid","_ctrlCash","_ctrlBleed","_bloodVal","_humanityName","_ctrlFood","_ctrlThirst","_thirstVal","_foodVal","_ctrlTemp","_tempVal","_combatVal","_array","_ctrlEar","_ctrlEye","_ctrlCombat","_ctrlFracture","_visualText","_visual","_audibleText","_audible","_blood","_thirstLvl","_foodLvl","_tempImg","_thirst","_food","_temp","_bloodLvl","_tempLvl","_color","_string","_humanity","_size","_friendlies","_charID","_rcharID","_rfriendlies","_rfriendlyTo","_distance","_targetControl","_humanityTarget","_ctrlBloodOuter","_ctrlFoodBorder","_ctrlThirstBorder","_ctrlTempBorder"];
disableSerialization;
//_thePlayer =player;
_foodVal =         1 - (dayz_hunger / SleepFood);
_thirstVal =     1 - (dayz_thirst / SleepWater);
_tempVal     =     1 - ((dayz_temperatur - dayz_temperaturmin)/(dayz_temperaturmax - dayz_temperaturmin));    // Normalise to [0,1]
_combatVal =    1 - dayz_combat; // May change later to be a range of red/green to loosely indicate 'time left in combat'
//_cashMoney         = _thePlayer getVariable["cashMoney",0];
//_bankMoney         = _thePlayer getVariable["bankMoney",0];
//_cash=[_cashMoney] call BIS_fnc_numberText;//3
//_balance=[_bankMoney] call BIS_fnc_numberText;


_pOn= (count playableUnits);
_display = uiNamespace getVariable 'DAYZ_GUI_display';


_ctrlBloodOuter = _display displayCtrl 1200;
_ctrlFoodBorder = _display displayCtrl 1201;
_ctrlThirstBorder = _display displayCtrl 1202;
_ctrlTempBorder = _display displayCtrl 1208;
//Border white
_ctrlBloodOuter ctrlSetTextColor [1,1,1,1];
_ctrlFoodBorder ctrlSetTextColor [1,1,1,1];
_ctrlThirstBorder ctrlSetTextColor [1,1,1,1];
_ctrlTempBorder ctrlSetTextColor [1,1,1,1];


_ctrlBlood =     _display displayCtrl 1300;
_ctrlBleed =     _display displayCtrl 1303;
_bloodVal =        r_player_blood / r_player_bloodTotal;
_ctrlFood =     _display displayCtrl 1301;
_ctrlThirst =     _display displayCtrl 1302;
_ctrlTemp     =     _display displayCtrl 1306;                    //TeeChange
_ctrlEar =         _display displayCtrl 1304;
_ctrlEye =         _display displayCtrl 1305;
_ctrlHumanity = _display displayCtrl 1207;
_ctrlCash = _display displayCtrl 1431;
_ctrlCombat = _display displayCtrl 1307;
_ctrlFracture =     _display displayCtrl 1203;
_ctrlPlayerOnline =_display displayCtrl 1427;
//_ctrlCash =_display displayCtrl 1429;
//_ctrlBank =_display displayCtrl 1431;


_ctrlBloodAmount = _display displayCtrl 1420;
_ctrlHumanityAmount = _display displayCtrl 1421;
_ctrlServerRestart = _display displayCtrl 1422;


_bloodTotal = r_player_blood;
_RestartTime = 360-(round(serverTime/60));


_ctrlBloodAmount      ctrlSetText str(_bloodTotal);
_ctrlHumanityAmount ctrlSetText str(player getVariable['humanity', 0]);
_ctrlPlayerOnline ctrlSetText str(_pOn);
_Player = player;
Money                 =         _Player getVariable["cashMoney",0];
Bank_Balance         =         _Player getVariable["bankMoney",0];
_ctrlCash ctrlSetStructuredText parseText format 
["
<t size='0.9'> %1 </t><img size='0.9' align='right' image='custom\gui\status\dollars.paa'/><br/>
<t size='0.9'> %2 </t><img size='0.9' align='right' image='custom\gui\status\Bank.paa'/><br/>",
[Money] call BIS_fnc_numberText,
[Bank_Balance] call BIS_fnc_numberText
];
    _ctrlCash ctrlCommit 0;
//_ctrlCash= ctrlSetText str(player getVariable["cashMoney",0]);
//_ctrlBank= ctrlSetText str(player getVariable["bankMoney",0]);
_ctrlServerRestart  ctrlSetText str(_RestartTime);


_ctrlFPS = _display displayCtrl 1321;
_ctrlFPSOuter = _display displayCtrl 1322;


_fps = round diag_FPS;
_ctrlFPS ctrlSetText str(_fps);
_ctrlFPS ctrlSetTextColor [0.6, 0.73, 0.0, 0.75];


_ctrlhumanKills = _display displayCtrl 1400;
//_ctrlhHeadshots = _display displayCtrl 1401;
_ctrlbanditKills= _display displayCtrl 1402;
_ctrlzombieKills= _display displayCtrl 1403;


_ctrlhumanKills  ctrlSetText str(player getVariable["humanKills", 0]);
_ctrlbanditKills ctrlSetText str(player getVariable["banditKills", 0]);
_ctrlzombieKills ctrlSetText str(player getVariable["zombieKills", 0]);
//_ctrlhHeadshots  ctrlSetText str(player getVariable["headShots", 0]);


//Food/Water/Blood
_ctrlBlood ctrlSetTextColor     [(Dayz_GUI_R + (0.3 * (1-_bloodVal))),(Dayz_GUI_G * _bloodVal),(Dayz_GUI_B * _bloodVal), 0.5];
_ctrlFood ctrlSetTextColor         [(Dayz_GUI_R + (0.3 * (1-_foodVal))),(Dayz_GUI_G * _foodVal),(Dayz_GUI_B * _foodVal), 0.5];
_ctrlThirst ctrlSetTextColor     [(Dayz_GUI_R + (0.3 * (1-_thirstVal))),(Dayz_GUI_G * _thirstVal),(Dayz_GUI_B * _thirstVal), 0.5];
_ctrlTemp ctrlSetTextColor         [(Dayz_GUI_R + (0.3 * (1-_tempVal))), (Dayz_GUI_G * _tempVal), _tempVal, 0.5];    // Color ranges from iceblue (cold) to red (hot)
_ctrlCombat ctrlSetTextColor    [(Dayz_GUI_R + (0.3 * (1-_combatVal))),(Dayz_GUI_G * _combatVal),(Dayz_GUI_B * _combatVal), 0.5];


_blood = "";
_thirst = "";
_food = "";
_temp = "";
_tempImg = 0;
_bloodLvl = round((r_player_blood / 2) / 1000);
_thirstLvl = round(_thirstVal / 0.25);
_foodLvl = round(_foodVal / 0.25);
_tempLvl = round(dayz_temperatur);


if (_bloodLvl <= 0) then { 
    _blood = "\z\addons\dayz_code\gui\status\status_blood_inside_1_ca.paa";
    } else {
    _blood = "\z\addons\dayz_code\gui\status\status_blood_inside_" + str(_bloodLvl) + "_ca.paa";
    };


if (_thirstLvl < 0) then { _thirstLvl = 0 };
_thirst = "\z\addons\dayz_code\gui\status\status_thirst_inside_" + str(_thirstLvl) + "_ca.paa";


if (_foodLvl < 0) then { _foodLvl = 0 };
_food = "\z\addons\dayz_code\gui\status\status_food_inside_" + str(_foodLvl) + "_ca.paa";


if ( _tempLvl >= 36 )                            then { _tempImg = 4 };
if ( _tempLvl > 33 && _tempLvl < 36 )            then { _tempImg = 3 };
if ( _tempLvl >= 30 && _tempLvl <= 33 )            then { _tempImg = 2 };
if ( _tempLvl > 28 && _tempLvl < 30 )            then { _tempImg = 1 };
if ( _tempLvl <= 28 )                            then { _tempImg = 0 };


_temp = "\z\addons\dayz_code\gui\status\status_temp_" + str(_tempImg) + "_ca.paa";


_ctrlBlood ctrlSetText _blood;
_ctrlThirst ctrlSetText _thirst;
_ctrlFood ctrlSetText _food;
_ctrlTemp ctrlSetText _temp;


/*
    Visual:
*/
_visual = (dayz_disVisual / 185) min 1;
if (_visual < 0.2) then {_visual = 0.2;};
_ctrlEye  ctrlSetTextColor [1, 1, 1, _visual];


/*
    Audible:
*/
_audible = (dayz_disAudial / 40) min 1;
if (_audible < 0.2) then {_audible = 0.2;};
_ctrlEar ctrlSetTextColor [1, 1, 1, _audible];


/*
    Fracture:
*/
if (!canStand player) then {
    if (!(ctrlShown _ctrlFracture)) then {
        r_fracture_legs = true;
        _ctrlFracture ctrlShow true;
    };
};


/*
    Flashing:
*/
if (_combatVal == 0) then {
    _ctrlCombat call player_guiControlFlash;
};


if (_bloodVal < 0.2) then {
    _ctrlBlood call player_guiControlFlash;
};


if (_thirstVal < 0.2) then {
    _ctrlThirst call player_guiControlFlash;
};


if (_foodVal < 0.2) then {
    _ctrlFood call player_guiControlFlash;
};


if (_tempVal > 0.8) then {    //TeeChange
    _ctrlTemp call player_guiControlFlash;
} else {
    _ctrlTemp ctrlShow true;
};


if (r_player_injured) then {
    _ctrlBleed call player_guiControlFlash;
};


/*
Opt-in tag system with friend tagging
*/
_string = "";
_humanityTarget = cursorTarget;
if (!isNull _humanityTarget && isPlayer _humanityTarget && alive _humanityTarget) then {


    _distance = player distance _humanityTarget;


    if (_distance < DZE_HumanityTargetDistance) then {
        
        _size = (1-(floor(_distance/5)*0.1)) max 0.1;


        // Display name if player opt-in || if friend
        _friendlies = player getVariable ["friendlies", []];
        //_charID = player getVariable ["CharacterID", "0"];
        //PLOTPOLE4LIFE CODE
        if (DZE_APlotforLife) then {
            _playerUID = [player] call FNC_GetPlayerUID;
            _rplayerUID = [_humanityTarget] call FNC_GetPlayerUID;
        }else{
            _playerUID = player getVariable ["CharacterID", "0"];
            _rplayerUID = _humanityTarget getVariable ["CharacterID", "0"];
        };


        _rfriendlies = _humanityTarget getVariable ["friendlies", []];
        _rfriendlyTo = _humanityTarget getVariable ["friendlyTo", []];


        if ((_rplayerUID in _friendlies) && (_playerUID in _rfriendlies)) then {


            if !(_playerUID in _rfriendlyTo) then {
                // diag_log format["IS FRIENDLY: %1", _player];
                _rfriendlyTo set [count _rfriendlyTo, _playerUID];
                _humanityTarget setVariable ["friendlyTo", _rfriendlyTo, true];
            };
    
            // <br /><t %2 align='center' size='0.7'>Humanity: %3</t>


            _color = "color='#339933'";
            _string = format["<t %2 align='center' size='%3'>%1</t>",(name _humanityTarget),_color,_size];
        
        } else {


            // Humanity checks
            _humanity = _humanityTarget getVariable ["humanity",0];


            _color = "color='#ffffff'";
            if(_humanity < -5000) then {
                _color = "color='#ff0000'";
            } else {
                if(_humanity > 5000) then {
                    _color = "color='#3333ff'";
                };
            };
            if((_humanityTarget getVariable ["DZE_display_name", false]) || (DZE_ForceNameTagsInTrader && isInTraderCity)) then {
                _string = format["<t %2 align='center' size='%3'>%1</t>",(name _humanityTarget),_color,_size];
            };
        };
    };
};


// update gui if changed
if (dayz_humanitytarget != _string) then {
    _targetControl = _display displayCtrl 1199;
    _targetControl ctrlSetStructuredText (parseText _string);
    dayz_humanitytarget = _string;
};
_array = [_foodVal,_thirstVal];
_array
 

 

Edited by TheFirstNoob (see edit history)

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts




  • 0
14 часа назад, BIG_MONSTR сказал:

CaptainStubin в папке аддона @DayZ_Epoch\addons\dayz_code\compile

этот файл при кастомном GUI должен находится в папке с миссией.... и вызыватся так же из кастомного compile.sqf

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 Miduznya
      Люди помогите кто знает, перепробовал множество вариантов
      ехе качал с сайта ragezone который типа переделан и в нем не работает БЕ
      но если зайти на сервер и выключить БЕ на клиенте через лаунчер, с сервера кикает, так что этот вариант не рабочий
      battleye = 0; тоже ничего не дает, кикает с сервера тоже.
      если не хотите тут можно и в лс , буду рад любой помощи.
    • By 123new
      В данной теме я ничего не прошу. Эта тема исключительно для обмена информацией и файлами со Steam мастерской и инструментов Steam, преимущественно для тех. кто не может их загрузить сам по тем или иным причинам.
       
      Форма запроса:
      1. Помогите скачать: {название и ссылка на необходимое вам, можно перечислить списком}
      2. Предпочитаю скачивать через: {названия облачных хранилищ, torrent, если работает}
      3. Буду ждать результата до: {дата, время по GMT+3, до которой вы ждете что вам помогут}
       
      Обращаю внимание, что все запросы и помощь исключительно добровольные между всеми форумчанами, никто ничем никому не обязан. Если по какой-то причине вам никто не может помочь загрузить файлы ищите свои способы это сделать сами.
      Форма запроса рекоммендуемая, но не обязательная в теме.
       
      ВАЖНО!! Благодарности за помощь оставлять в виде поднятия репутации автору за сообщение с нужной вам ссылкой.
    • By JEKA666
      Кто нибудь знает как настроить( Х ) НА  лут в лучах и рыбалку какие команды прописывать? Хочется чтоб они приносили что-то нужное и полезное или только модом.
    • By danulo95
      здраствуйте подскажите каким образом можна реализировать привязку UID\GUID к никнейму игрока штоб викоренить смену никнеймов на сервере
    • By donscrin1337
      Как сделать постоянную контрастность на сервере?
  • 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.