Also ich hab versucht für den On Duty Modus für Supporter und Admins ein Player tag zu erstellen jedoch ist die fn_playerTags.sqf jetzt komplett broke und ich bin einfach zu müde oder zu blöd den Fehler zu finden vielleicht hat ja jemand einen Lösungsvorschlag
Die fn_playerTags.sqf:
SQL
#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];
};
{ life_known_Players pushBackUnique _x; } forEach (units(group player));
_units = nearestObjects[(visiblePosition player),["Land_Pallet_MilBoxes_F","Land_Sink_F"],50];
{ if((player distance _x < 50) && {_x in life_known_Players} && {_x isEqualTo vehicle _x}) then {_units pushBack _x};} foreach playableUnits;
_units = _units - [player];
if(!(player getVariable ['admin_mode',''] isEqualTo '')) then {
{ if(player distance _x < 50) then {_units pushBackUnique _x};} foreach allPlayers;
} else {
{ if((player distance _x < 50) && ((_x in life_known_Players) OR !(_x getVariable ['admin_mode',''] isEqualTO ''))) then {_units pushBackunique _x};} foreach allPlayers;
};
//_masks = LIFE_SETTINGS(getArray,"clothing_masks");
{
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 (!((headgear _x) in _masks || (goggles _x) in _masks || (uniform _x) in _masks)) then {
if (count _sPos > 1 && {_distance < 15}) then {
_text = switch (true) do {
case (_x in (units group player) && playerSide == civilian): {format ["<t color='#00FF00'>%1</t>",(_x getVariable ["realname",name _x])];};
case (!isNil {(_x getVariable "rank")} && side _x == west): {format["<img image='%1' color='#FFFFFF' size='1'></img><t color='#0044FF'>%3</t><br/><t color='#FFFFFF'>%2</t>",
switch ((_x getVariable "rank")) do {
case 2: {"\a3\ui_f\data\gui\cfg\Ranks\corporal_gs.paa"};
case 3: {"\a3\ui_f\data\gui\cfg\Ranks\sergeant_gs.paa"};
case 4: {"Images\Icons\rank_obermeister.paa"};
case 5: {"Images\Icons\rank_hauptmeister.paa"};
case 6: {"\a3\ui_f\data\gui\cfg\Ranks\major_gs.paa"};
case 7: {"\a3\ui_f\data\gui\cfg\Ranks\general_gs.paa"};
case 8: {"Images\Icons\rank_rat.paa"};
case 9: {"\a3\ui_f\data\gui\cfg\Ranks\general_gs.paa"};
case 10: {"\a3\ui_f\data\gui\cfg\Ranks\lieutenant_gs.paa"};
case 11: {"\a3\ui_f\data\gui\cfg\Ranks\lieutenant_gs.paa"};
case 12: {"\a3\ui_f\data\gui\cfg\Ranks\lieutenant_gs.paa"};
case 13: {"\a3\ui_f\data\gui\cfg\Ranks\colonel_gs.paa"};
case 14: {"\a3\ui_f\data\gui\cfg\Ranks\colonel_gs.paa"};
case 15: {"\a3\ui_f\data\gui\cfg\Ranks\colonel_gs.paa"};
case 16: {"Images\Icons\rank_direktor.paa"};
case 17: {"Images\Icons\rank_direktor.paa"};
case 18: {"Images\Icons\rank_direktor.paa"};
case 19: {"\a3\ui_f\data\gui\cfg\Ranks\lieutenant_gs.paa"};
case 20: {"\a3\ui_f\data\gui\cfg\Ranks\colonel_gs.paa"};
default {"Images\Icons\rank_anwaerter.paa"};
},
_x getVariable ["realname",name _x],
switch ((_x getVariable "rank")) do {
case 2: {"Officer"};
case 3: {"Sergeant"};
case 4: {"Lieutenend"};
case 5: {"Captain"};
case 6: {"Inspector"};
case 7: {"Marshal"};
case 8: {"Chief Marshal"};
case 9: {"Major"};
case 10: {"Federal Buero of Investigation"};
case 11: {"Federal Buero of Investigation"};
case 12: {"Federal Buero of Investigation"};
case 13: {"S.E.A.L. Team"};
case 14: {"S.E.A.L. Team"};
case 15: {"S.E.A.L. Team"};
case 16: {"Secretary of Police"};
case 17: {"Deputy Chief of Police"};
case 18: {"Chief of Police"};
case 19: {"F.B.I. Director"};
case 20: {"S.E.A.L. Director"};
default {"Recruit"};
}
]
};
case (side _x isEqualTo independent): {format["<img color='#%4' image='%1' size='1'></img><t color='#FF0000'>%3</t><br/><t color='#FFFFFF'>%2</t>",
switch ((_x getVariable "medicRank")) do {
case 2: {"Images\Icons\fw_b1.paa"};
case 3: {"Images\Icons\fw_b2.paa"};
case 4: {"Images\Icons\fw_b3.paa"};
case 5: {"Images\Icons\fw_b1.paa"};
case 6: {"Images\Icons\fw_b3.paa"};
case 7: {"Images\Icons\fw_b0.paa"};
case 8: {"Images\Icons\fw_b0.paa"};
case 9: {"Images\Icons\fw_b3.paa"};
default {"Images\Icons\fw_b0.paa"};
},
_x getVariable ["realname",name _x],
switch ((_x getVariable "medicRank")) do {
case 2: {"Firefighter"};
case 3: {"Engineer"};
case 4: {"Lieutenend"};
case 5: {"Captain"};
case 6: {"Instructor"};
case 7: {"Battalion Chief"};
case 8: {"Deputy Chief"};
case 9: {"Chief"};
default {"Trainee"};
}
]
};
default {
if (!isNil {(group _x) getVariable "gang_name"}) then {
format["%1<br/><t size='0.8' color='#B6B6B6'>%2</t>",_x getVariable ["realname",name _x],(group _x) getVariable ["gang_name",""]];
} else {
_x getVariable ["realname",name _x];
};
};
};
_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;
};
} forEach _units;
Alles anzeigen