Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #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.
- */
- #define iconID 78000
- #define scale 0.8
- if(visibleMap OR {!alive player} OR {dialog}) exitWith {
- 500 cutText["","PLAIN"];
- };
- private _ui = GVAR_UINS ["Life_HUD_nameTags",displayNull];
- if(isNull _ui) then {
- 500 cutRsc["Life_HUD_nameTags","PLAIN"];
- _ui = GVAR_UINS ["Life_HUD_nameTags",displayNull];
- };
- private _units = player nearEntities ["Man", 50];
- SUB(_units,[player]);
- {
- private _text = "";
- _idc = _ui displayCtrl (iconID + _forEachIndex);
- if(!(lineIntersects [eyePos player, eyePos _x, player, _x]) && {!isNil {_x GVAR "realname"}} && alive _x) then {
- _pos = [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 {
- _text = switch (true) do {
- case (_x in (units grpPlayer) && playerSide isEqualTo civilian): {format["<t color='#00FF00'>%1</t>",format ["ID %1: %2",_x GVAR ["playerID","0"],_x GVAR ["realname",name _x]]];};
- case (_x in life_memoryList && side _x isEqualTo civilian): {format ["ID %1: %2",_x GVAR ["playerID","0"],_x GVAR ["realname",name _x]];};
- case (!isNil {(_x GVAR "rank")} && playerSide isEqualTo west): {
- format[
- "<img image='%1' size='1'></img> %2<br/><t size='0.8' color='#0266C8'>%3</t>",
- switch ((_x GVAR "rank")) do {
- case 2: {"C:\Users\Administrator\Desktop\Serveur Arma3\steamapps\common\Arma 3 Server\mpmissions\Tanoa_Life.Tanoa\icons\pn\Gardien.paa"};
- case 3: {"C:\Users\Administrator\Desktop\Serveur Arma3\steamapps\common\Arma 3 Server\mpmissions\Tanoa_Life.Tanoa\icons\pn\SousBrigadier.paa"};
- case 4: {"C:\Users\Administrator\Desktop\Serveur Arma3\steamapps\common\Arma 3 Server\mpmissions\Tanoa_Life.Tanoa\icons\pn\Brigadier.paa"};
- case 5: {"C:\Users\Administrator\Desktop\Serveur Arma3\steamapps\common\Arma 3 Server\mpmissions\Tanoa_Life.Tanoa\icons\pn\BrigadierChef.paa"};
- case 6: {"C:\Users\Administrator\Desktop\Serveur Arma3\steamapps\common\Arma 3 Server\mpmissions\Tanoa_Life.Tanoa\icons\pn\BrigadierMajor.paa"};
- case 7: {"C:\Users\Administrator\Desktop\Serveur Arma3\steamapps\common\Arma 3 Server\mpmissions\Tanoa_Life.Tanoa\icons\pn\EleveLieutenant.paa"};
- case 8: {"C:\Users\Administrator\Desktop\Serveur Arma3\steamapps\common\Arma 3 Server\mpmissions\Tanoa_Life.Tanoa\icons\pn\Lieutenant.paa"};
- case 9: {"C:\Users\Administrator\Desktop\Serveur Arma3\steamapps\common\Arma 3 Server\mpmissions\Tanoa_Life.Tanoa\icons\pn\Capitaine.paa"};
- case 10: {"C:\Users\Administrator\Desktop\Serveur Arma3\steamapps\common\Arma 3 Server\mpmissions\Tanoa_Life.Tanoa\icons\pn\Commandant.paa"};
- case 11: {"C:\Users\Administrator\Desktop\Serveur Arma3\steamapps\common\Arma 3 Server\mpmissions\Tanoa_Life.Tanoa\icons\pn\Commissairedepolice.paa"};
- default {"C:\Users\Administrator\Desktop\Serveur Arma3\steamapps\common\Arma 3 Server\mpmissions\Tanoa_Life.Tanoa\icons\pn\Gardien Stagiaire.paa"};
- },
- format ["ID %1: %2",_x GVAR ["playerID","0"],_x GVAR ["realname",name _x]],
- switch ((_x GVAR "rank")) do {
- case 2: {"Gardien"};
- case 3: {"Sous Brigadier"};
- case 4: {"Brigadier"};
- case 5: {"Brigadier Chef"};
- case 6: {"Brigadier Major"};
- case 7: {"Eleve Lieutenant"};
- case 8: {"Lieutenant"};
- case 9: {"Capitaine"};
- case 10: {"Commandant"};
- case 11: {"Commissaire de police"};
- default {"Gardien Stagiaire"};
- }
- ]
- };
- case (!isNil {(_x GVAR "medicRank")} && playerSide isEqualTo independent): {
- _t = "Recrue";
- if (_x GVAR ["medicType",name _x] isEqualTo "MED") then {
- _t = switch ((_x GVAR "medicRank")) do {
- case 2: {"Infirmier Apprenant"};
- case 3: {"Infirmier Aspirant"};
- case 4: {"Infirmier"};
- case 5: {"Infirmier-Chef"};
- case 6: {"Médecin 2nde Classe"};
- case 7: {"Médecin 1re Classe"};
- case 8: {"Médecin"};
- case 9: {"Médecin-Chef"};
- case 10: {"Médecin Capitaine"};
- case 11: {"Médecin Commandant"};
- case 12: {"Médecin Ltn-Colonel"};
- case 13: {"Médecin Colonel"};
- default {"Recrue"};
- };
- } else {
- _t = switch ((_x GVAR "medicRank")) do {
- case 2: {"Sapeur 2nde Classe"};
- case 3: {"Sapeur 1re Classe"};
- case 4: {"Caporal"};
- case 5: {"Brigadier"};
- case 6: {"Brigadier-Chef"};
- case 7: {"Adjudant"};
- case 8: {"Adjudant-Chef"};
- case 9: {"Lieutenant"};
- case 10: {"Capitaine"};
- case 11: {"Commandant"};
- case 12: {"Ltn-Colonel"};
- case 13: {"Colonel"};
- default {"Recrue"};
- };
- };
- format[
- "<t color='#02A001'><img image='\a3\ui_f\data\map\MapControl\hospital_ca.paa' size='1'></img></t> %1<br/><t size='0.8' color='#02A001'>%2</t>",
- format ["ID %1: %2",_x GVAR ["playerID","0"],_x GVAR ["realname",name _x]], _t
- ]
- };
- case (FETCH_CONST(life_adminlevel) >= 1): {
- format ["ID %1: %2",_x GVAR ["playerID","ERROR"],_x GVAR ["realname",name _x]]
- };
- default {
- format ["ID %1",_x GVAR ["playerID","ERROR"]]
- };
- };
- _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;
- };
- } foreach _units;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement