DarkRP - Hide character info above head if cloaked ?

Hi recently i have been working on creating an undercover admin system and i have been trying to make it so when you are cloaked your DarkRP info (Name,hp,Job) dont display. I have tried looking around and found this.


 hook.Add("HUDShouldDraw","DarkRP_HideJobsEntityDisplay",function(hudName)
   if hudName ~="DarkRP_EntityDisplay"then return end

   local playersToDraw ={}
   for _,ply in pairs(player.GetAll())do
       if not ply:GetMaterial() == "models/effects/vol_light001" then
           table.insert(playersToDraw, ply)
       end
   end
   return true, playersToDraw
end


I have tried editing/fiddling with the code/hud functions to try get it to work, but cannot. Any help would be appreciated thanks.

Try

Entity:GetNoDraw

Hi, how would i go about using this to hide this info ? i have tried using v:IsEffectActive(EF_NODRAW) (according to wiki its the same thing as GetNoDraw)

It looks like DarkRP already does a check for this.

Just make sure your cloaked players have nodraw enabled.

Ahh, so i would i be able to have like ply:GetNoDraw() = true? Then it will stop drawing the info ?



-- Call when player cloaks
ply:SetNoDraw(true)

-- Call when player uncloacks
ply:SetNoDraw(false)


Hi, thanks for responding.

I tried out what you posted and got the opposite of what i needed. I need it so it sets the player info invisible, not the player itself. (https://gyazo.com/fdb66ded700b9a0b745497a21d385565 what setnodraw does). Is there a way to make it so the player information disappears (Name,Job,HP)

Perhaps I’m misunderstanding the “cloak”. I don’t really know DarkRP. Does it not already make you invisible? Also not sure why that entity info display isn’t going away based on the github link I gave above…

If anyone has a solution dont be shy :slight_smile:

Youll have to do the unspeakable thing…
Edit the DarkRP file :sick:

no. what we need to know is how he is cloaking the player, whether it is by material, SetNoDraw, or SetColor and SetRenderMode.

Can you post the full code so we know what we are working with.

Im using ulx cloak to “cloak” the player which uses SetRenderMode( RENDERMODE_NORMAL ) and SetMaterial( “” )

[editline]20th January 2016[/editline]



The full code is in the original post
 hook.Add("HUDShouldDraw","DarkRP_HideJobsEntityDisplay",function(hudName)
   if hudName ~="DarkRP_EntityDisplay"then return end

   local playersToDraw ={}
   for _,ply in pairs(player.GetAll())do
       if not ply:GetMaterial() == "models/effects/vol_light001" then
           table.insert(playersToDraw, ply)
       end
   end
   return true, playersToDraw
end


[editline]20th January 2016[/editline]

I only want the CLOAKED players to not have this information showing not ALL players as stated at the top.