Hey liebe NN Community folgendes Problem,
moeck und ich versuchen seit stunden es hinzu bekommen dass nur die Medics einen Playertag haben und die CIV's und Cop's nicht so sieht meine Datei aus:
Code
#include "..\..\script_macros.hpp"
/*
File: fn_playerTags.sqf
Author: Bryan "Tonic" Boardwine
Description:
Adds the tags above other players heads when close and have visible range.
*/
if (!life_settings_tagson) exitWith {};
private ["_ui","_units","_masks"];
#define iconID 78000
#define scale 0.8
if (visibleMap || {!alive player} || {dialog}) exitWith {
500 cutText["","PLAIN"];
};
_ui = uiNamespace getVariable ["Life_HUD_nameTags",displayNull];
if (isNull _ui) then {
500 cutRsc["Life_HUD_nameTags","PLAIN"];
_ui = uiNamespace getVariable ["Life_HUD_nameTags",displayNull];
};
_units = nearestObjects[(visiblePosition player),["Man","Land_Pallet_MilBoxes_F","Land_Sink_F"],50];
_units = _units - [player];
_masks = LIFE_SETTINGS(getArray,"clothing_masks");
private _index = -1;
{
private _text = "";
_idc = _ui displayCtrl (iconID + _forEachIndex);
if (!(lineIntersects [eyePos player, eyePos _x, player, _x]) && alive _x && {!isNil {_x getVariable "realname"}}) then {
_pos = switch (typeOf _x) do {
case "Land_Pallet_MilBoxes_F": {[visiblePosition _x select 0, visiblePosition _x select 1, (getPosATL _x select 2) + 1.5]};
case "Land_Sink_F": {[visiblePosition _x select 0, visiblePosition _x select 1, (getPosATL _x select 2) + 2]};
default {[visiblePosition _x select 0, visiblePosition _x select 1, ((_x modelToWorld (_x selectionPosition "head")) select 2)+.5]};
};
_sPos = worldToScreen _pos;
_distance = _pos distance player;
if (count _sPos > 1 && {_distance < 15}) then {
if (side _x isEqualTo independent) then {
_text = format ["<img image='%1' size='1.5'></img> %2",switch ((_x getVariable "rank")) do {
case 2: {"textures\Ranks\Medic.paa"};
case 3: {"textures\Ranks\Feuerwehr1.paa"};
case 4: {"textures\Ranks\Feuerwehr2.paa"};
case 5: {"textures\Ranks\Feuerwehr3.paa"};
default {"textures\Ranks\Adac.paa"};
},_x getVariable ["realname",name _x]];
hintSilent format ["Testhase: %1, Side: %2 Text: %3",(name _x),(side _x),_text];
_idc ctrlSetStructuredText parseText _text;
_idc ctrlSetPosition [_sPos select 0, _sPos select 1, 0.4, 0.65];
_idc ctrlSetScale scale;
_idc ctrlSetFade 0;
_idc ctrlCommit 0;
_idc ctrlShow true;
} else {
_idc ctrlShow false;
};
} else {
_idc ctrlShow false;
};
} else {
_idc ctrlShow false;
};
_index = _forEachIndex;
true
} count _units;
(_ui displayCtrl (iconID + _index + 1)) ctrlSetStructuredText parseText "";
Alles anzeigen
Absolut keine ahnung woran es liegt dass der Tag bei den Medics nicht angezeigt wird.
bis zum schritt: hintSilent format ["Testhase: %1, Side: %2 Text: %3",(name _x),(side _x),_text]; funktioniert alles
Hoffe ihr könnt helfen,
LG Lucky1302 - moeck