Jump to content
  • 0

Adding Nametags To Admins Only - Code 95% Done - Needs Some Pro Eyes


DY357LX

Question

Basically, I want "ADMIN: <ADMINNAME>"  to appear when a player points their crosshair at an Admin.

Here's what I've got so far:
 

_adminList = ["ADMINUID1","ADMINUID2"];
waitUntil {(getPlayerUID player) != ""};
Waituntil {!isNull player};
while{true} do
{
	sleep 0.5;
	_lpID = getPlayerUID cursorTarget;
	if((isPlayer cursorTarget) && (alive cursorTarget) && (side cursorTarget == side player) && (_lpID in _adminList) && (player distance cursorTarget < 10)) then
	{
		_cursorTargetName = name cursorTarget;
		cutText [format["ADMIN %1", _cursorTargetName], "PLAIN",0.1];
	}
	else
	{
	};
};

It's an adaptation of the CPC name tags code from a while back.
The code does show what I want but it's also showing the names of normal players.

Can anyone point out what I've done wrong please? I don't have a lot of .SQF experience but I think I'm on the right track.

Thanks.

Edited by DY357LX
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

_adminList = ["ADMINUID1","ADMINUID2"];

waitUntil {(getPlayerUID player) != ""};

Waituntil {!isNull player};

while {true} do {

sleep 0.5;

_ct = curscursorTarget;

_lpID = getPlayerUID _ct;

if ((isPlayer _ct) &&

(alive cursorTarget) &&

(_lpID in _adminList) &&

((player distance cursorTarget) < 10))) then {

 cutText [format ["ADMIN: %1",name _ct],"PLAIN",0.1];

 };

};

 

try this

i didnt tested it and just wrote it at work in my break

i can give it a try later this day, if wanted :)

Link to comment
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
  • Discord

×
×
  • Create New...