xMKHx

Dx Visibility

Recommended Posts

Hello, 
I'm making a dx counting but it's visible for everyone
I just want to make it visible only for a team or selected players with data
Here is an example 
 

-- Client

function Dx ()
  dxDrawText("text", 1, 1, 1, 1, tocolor(250, 120, 4, 255), 7.00, "bankgothic", "center", "center", false, false, false, false, false)
  end

-- After using this command it will show the Dx Text for Root
function showDx ()
  addEventHandler("onClientRender", root, Dx) 
  end
addCommandHandler("showdx", showDx)

I have tried many methods but nothing.

Share this post


Link to post

In show dx put 

getPlayerTeam
getTeamName or getElementData 

 

Share this post


Link to post
function Dx ()
  if getPlayerTeam(localPlayer) == getTeamFromName("Admins") then
    dxDrawText("text", 1, 1, 1, 1, tocolor(250, 120, 4, 255), 7.00, "bankgothic", "center", "center", false, false, false, false, false)
  end
end

 

  • Thanks 1

Share this post


Link to post

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

  • Recently Browsing   0 members

    No registered users viewing this page.