Hey^^
Ich habe das Problem, dass sich mein HUD nur aktualisiert, wenn der jeweilige Spieler ein Item konsumiert.
Oft wird dieses auch gar nicht angezeigt, und zeigt sich nur kurze Zeit nachdem ein Spieler etwas benutzt hat.
Ich hänge einmal die entsprechenden Dateien an
fn_hudUpdate.sqf:
Code
#include "..\..\script_macros.hpp"
/*
File: fn_hudUpdate.sqf
Author: PierreAmyf
Edited: Avirex
Desc: New Hud Menu
*/
disableSerialization;
if (isNull (uiNamespace getVariable ["playerHUD",displayNull])) then {[] call life_fnc_hudSetup;};
_polizeionline = 0;
_einwohneronline = 0;
_mediconline = 0;
{
if(isPlayer _x) then
{
_si = side _x;
if(_si == civilian) then {_einwohneronline = _einwohneronline + 1};
if(_si == west) then {_polizeionline = _polizeionline + 1};
if(_si == independent) then {_mediconline = _mediconline + 1};
};
} forEach(playableUnits);
//Text
((uiNamespace getVariable ["playerHUD",displayNull]) displayCtrl 2403) ctrlSetText format["%1 %",round ((1 - (damage player)) * 100)];
((uiNamespace getVariable ["playerHUD",displayNull]) displayCtrl 2400) ctrlSetText format["%1 %",life_hunger];
((uiNamespace getVariable ["playerHUD",displayNull]) displayCtrl 2402) ctrlSetText format["%1 %",life_thirst];
((uiNamespace getVariable ["playerHUD",displayNull]) displayCtrl 2407) ctrlSetText format["%1$",[life_atmbank] call life_fnc_numberText];
((uiNamespace getVariable ["playerHUD",displayNull]) displayCtrl 2408) ctrlSetText format["%1$",[life_cash] call life_fnc_numberText];
((uiNamespace getVariable ["playerHUD",displayNull]) displayCtrl 2405) ctrlSetText format["%1",_polizeionline];
((uiNamespace getVariable ["playerHUD",displayNull]) displayCtrl 2406) ctrlSetText format["%1",_mediconline];
((uiNamespace getVariable ["playerHUD",displayNull]) displayCtrl 2404) ctrlSetText format["%1",_einwohneronline];
Alles anzeigen
Und die fn_hudSetup.sqf:
Code
#include "..\..\script_macros.hpp"
/*
File: fn_hudSetup.sqf
Author: Bryan "Tonic" Boardwine
Description:
Setups the hud for the player?
*/
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) isEqualTo _dam)};
[] call life_fnc_hudUpdate;
};
};
Alles anzeigen
Komme einfach nicht drauf Iwie muss man ja einstellen können, das sich das HUD in gewissen Zeitabständen aktualisiert bzw. überhaupt angezeigt wird.
Wer mehr Infos braucht, gerne einfach anfragen^^