Ulysses
General => Developers Corner => Topic started by: Mr582 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.
-
Do you mean their name when you mouse over them?
-
No the blood. The name would be nice too.
-
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.
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
-
Mrpresident, Could he use WEAPON:DoImpactEffect() (http://wiki.garrysmod.com/page/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.
-
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.
-
I would be fine with no decals at all. No blood at all.
-
Is there a way to check if he has the weapon weapon_hidden and then do what MrPresident did
-
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 )