Author Topic: Disable Decals  (Read 5415 times)

0 Members and 1 Guest are viewing this topic.

Mr582

  • Guest
Disable Decals
« on: August 17, 2013, 05:55:51 PM »
Hello There. I am making a Hidden Gamemode in Gmod and when i was testing the main problem was that you could see the decals on the hiddens body, making it easy to see him. Is there a way to disable decals. If not can someone help me.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Disable Decals
« Reply #1 on: August 17, 2013, 06:30:02 PM »
Do you mean their name when you mouse over them?

Mr582

  • Guest
Re: Disable Decals
« Reply #2 on: August 17, 2013, 06:39:32 PM »
No the blood. The name would be nice too.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Disable Decals
« Reply #3 on: August 17, 2013, 06:40:55 PM »
Here is how you remove the player names

http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index6cc7.html

I'll take a look into the decals.


I couldn't find anything that jumped out at me at first glance. You could do it a pretty hacky way though if you want to.

Code: [Select]
function NoBloodHiddenPlayer( ply, atkr )
if ply:IsHiddenPlayer() then
for k, v in pairs( player.GetAll() ) do
v:ConCommand( "r_cleardecals" )
end
end
end
hook.Add( "PlayerHurt", "NoBloodHiddenPlayer", NoBloodHiddenPlayer )
The IsHiddenPlayer() boolean check would be replaced by you for whatever method you choose for tracking who is a hidden player or not.

[edit-JamminR] Placed hook.add into the code block
« Last Edit: August 17, 2013, 10:22:22 PM by JamminR »

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Disable Decals
« Reply #4 on: August 17, 2013, 07:04:41 PM »
Mrpresident, Could he use WEAPON:DoImpactEffect() to override, if the tr table it hit was the player entity that was 'hidden'.
I've no idea if that would work, or if it would work, if one would also have to write in the fact the player got hurt/etc too, though not seen.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Disable Decals
« Reply #5 on: August 17, 2013, 08:39:19 PM »
Yes, but this method is a weapon hook. I don't think you can use those outside the weapon files.

IE: He'd have to only be using custom SWEPs and no default weapons and he'd have to add that to every one of them or to the base SWEP if the others are using one.

Mr582

  • Guest
Re: Disable Decals
« Reply #6 on: August 17, 2013, 10:12:53 PM »
I would be fine with no decals at all. No blood at all.

Mr582

  • Guest
Re: Disable Decals
« Reply #7 on: August 20, 2013, 11:16:16 AM »
Is there a way to check if he has the weapon weapon_hidden and then do what MrPresident did

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Disable Decals
« Reply #8 on: August 20, 2013, 12:19:31 PM »
Code: [Select]
function NoBloodHiddenPlayer( ply, atkr )
if ply:GetActiveWeapon():GetClass() == "weapon_hidden" then
for k, v in pairs( player.GetAll() ) do
v:ConCommand( "r_cleardecals" )
end
end
end
hook.Add( "PlayerHurt", "NoBloodHiddenPlayer", NoBloodHiddenPlayer )