Raised This Month: $51 Target: $400
 12% 

Making a player invisible? (CS:S)


Post New Thread Reply   
 
Thread Tools Display Modes
zeroibis
Veteran Member
Join Date: Jun 2007
Old 02-26-2011 , 23:59   Re: Making a player invisible? (CS:S)
Reply With Quote #11

Ah I see, so the real thing that does it is just
SetEntProp(client, Prop_Send, "m_iAddonBits", -1);

Which simply disables them all together.

How often is this value reset though, each round or for the map ect?
__________________
zeroibis is offline
iamevilbear
Member
Join Date: Mar 2010
Old 02-27-2011 , 03:25   Re: Making a player invisible? (CS:S)
Reply With Quote #12

Quote:
Originally Posted by zeroibis View Post
Ah I see, so the real thing that does it is just
SetEntProp(client, Prop_Send, "m_iAddonBits", -1);

Which simply disables them all together.

How often is this value reset though, each round or for the map ect?
No using that didn't work for me. The client still had visible smoke/flash/hegrenade attachments on his model.

I read a thread that said changing the model of the player could solve this issue. Would it be best to just change the player model to a zombie or something?

Or does anyone know a way to hide or find those attachment entities.
iamevilbear is offline
spunkster21
Senior Member
Join Date: Aug 2008
Old 02-27-2011 , 05:13   Re: Making a player invisible? (CS:S)
Reply With Quote #13

I don't believe there is any way to do this without changing the model to one without any attachable items. If you do find a way, please post your results.
spunkster21 is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 02-27-2011 , 13:19   Re: Making a player invisible? (CS:S)
Reply With Quote #14

come on guys, i gave you 3 net props. i said try -1 which didn't work and i said try in one of the thinks, that doesn't mean you give up and thats the end of it, you have to fiddle with them to see what values do what. not bothering after trying 1 value is just lazy and especially if you expect someone else to do all the work. this is the last time i'll do the work, people on these forums need to stop being so lazy.

"m_iAddonBits" is bitwise, it defines what attachments to show, here are the values.

PHP Code:
0     none
1     flashbang 1
2     flashbang 2
4     hegrenade
8     smokegrenade
16     c4
32     defuser
64     primary weapon
128     pistol
256     extra holster 
for dual elites 
"m_iPrimaryAddon" and "m_iSecondaryAddon" define what model to show on the players back or holster when their addon bit is enabled. here are the values.

PHP Code:
0     none
1     p228
2     glock
3     scout
4     hegrenade
5     xm1014
6     c4
7     mac10
8     aug
9     smokegrenade
10     elite
11     fiveseven
12     ump45
13     sg550
14     galil
15     famas
16     usp
17     awp
18     mp5navy
19     m249
20     m3
21     m4a1
22     tmp
23     g3sg1
24     flashbang
25     deagle
26     sg552
27     ak47
28     knife
29     p90 
you have to set all net props in sdkhooks postthinkpost.

note you can make any of the above models show up in the primary or secondary attachment so you can have a knife showing on the players back or an awp in the holster.
blodia is offline
zeroibis
Veteran Member
Join Date: Jun 2007
Old 02-27-2011 , 14:52   Re: Making a player invisible? (CS:S)
Reply With Quote #15

Quote:
Originally Posted by blodia View Post
you have to set all net props in sdkhooks postthinkpost.
This is exactly why I said:
Quote:
How often is this value reset though, each round or for the map ect?
I figured there was going to be some little trick like that. Cool, now that I know all the details I will give this a try when I have some time
__________________
zeroibis is offline
DarkEnergy
SourceMod Donor
Join Date: Apr 2008
Location: Georgia Tech, MSECE
Old 02-27-2011 , 18:50   Re: Making a player invisible? (CS:S)
Reply With Quote #16

i tried setting on prethink, postthink, gameframe, none of them works. the model periodically disappears for 1 frame and reappears in an unpredictable pattern
__________________
War3:Source Developer
"Your CPU is just a bunch of Muxes"
DarkEnergy is offline
zeroibis
Veteran Member
Join Date: Jun 2007
Old 02-27-2011 , 21:52   Re: Making a player invisible? (CS:S)
Reply With Quote #17

But did you do postthinkpost as stated above?
__________________
zeroibis is offline
iamevilbear
Member
Join Date: Mar 2010
Old 02-27-2011 , 22:09   Re: Making a player invisible? (CS:S)
Reply With Quote #18

I moved everything into postthinkpost, but I have a quick question and exuse my ignorance as this may stem from my limited knowledge of sourcemod scripting with bitwise operators, but if I wanted to change the value to zero wouldn't I just do the following?

Code:
public OnClientPutInServer(client) 
{ 
    SDKHook(client,SDKHook_PostThinkPost,SDK_Forwarded_PostThinkPost);
} 

public OnClientDisconnect(client) 
{ 
    if(IsClientInGame(client)) 
    { 
    	SDKUnhook(client,SDKHook_PostThinkPost,SDK_Forwarded_PostThinkPost);
    } 
}

public SDK_Forwarded_PostThinkPost(client)
{
	if(GetConVarInt(g_cVarIMEnable) == 1)
	{
		if(playerINV[client] == 1)
		{
			SetEntProp(client, Prop_Send, "m_iAddonBits", 0);
			SetEntProp(client, Prop_Send, "m_iPrimaryAddon", 0);
			SetEntProp(client, Prop_Send, "m_iSecondaryAddon", 0);
		}
	}
}
ignore the other fluff code that handles off and on in my particular example.
iamevilbear is offline
zeroibis
Veteran Member
Join Date: Jun 2007
Old 02-28-2011 , 00:20   Re: Making a player invisible? (CS:S)
Reply With Quote #19

I do not see any problem that is how I assumed it looked when I read above. Have you tired it yet?
__________________
zeroibis is offline
DarkEnergy
SourceMod Donor
Join Date: Apr 2008
Location: Georgia Tech, MSECE
Old 02-28-2011 , 01:42   Re: Making a player invisible? (CS:S)
Reply With Quote #20

i tried sdkhooks postthinkpost, still flashes the model
__________________
War3:Source Developer
"Your CPU is just a bunch of Muxes"
DarkEnergy is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:45.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode