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

[TF2] SDKHook_SetTransmit and Miniguns?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 08-18-2013 , 02:06   [TF2] SDKHook_SetTransmit and Miniguns?
Reply With Quote #1

Okay, so I'm experimenting with different ways of hiding Friendly players from non-Friendly players. One thing that was suggested a while back was SetTransmit provided by SDKHooks.

Code:
public Action:Hook_SetTransmit(client, entity) {     if (cvar_settransmit == 0 || !IsValidClient(client) || !IsValidClient(entity)) {         return Plugin_Continue;     }     if (cvar_settransmit > 0 && !IsFriendly[entity] && IsFriendly[client]) {         return Plugin_Handled;     }     if (cvar_settransmit == 2 && IsFriendly[entity] && !IsFriendly[client]) {         return Plugin_Handled;     }     return Plugin_Continue; }

This seems to work pretty well. Even silences footsteps. (Voice commands and attacks are still audible, but I'll tackle that myself later.)

However, it doesn't seem to work if the player in question has a minigun equipped? Why is this? Is there some other known issue that causes this? How can I fix this, short of actually removing the weapon from the Friendly Heavy?


I have unloaded all other plugins to test this. The issue still occurs.

Server info:
Spoiler

Last edited by ddhoward; 08-18-2013 at 02:58.
ddhoward is offline
psychonic

BAFFLED
Join Date: May 2008
Old 08-18-2013 , 10:21   Re: [TF2] SDKHook_SetTransmit and Miniguns?
Reply With Quote #2

Miniguns are set to always transmit. If you want them to do a check each frame and go through SetTransmit, you'll have to set the edict flags accordingly.
psychonic is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 08-19-2013 , 07:36   Re: [TF2] SDKHook_SetTransmit and Miniguns?
Reply With Quote #3

Setttransmit fires every frame so you are doing tonshit of unneccessary stuff there.

I think you can just send ef nodraw to the entity effects and it won't be transmitted also
https://developer.valvesoftware.com/wiki/Effects_enum

You can undo it by removing it and marking edict as changed...

Other things you can try is stuff like changing the modelsize to make it very small, and then setting it back to normal, which is also reversable.

Otherwise you can do things like setting the world index to -1, or just removing the weaponslot.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 08-19-2013 at 07:39.
friagram is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 08-19-2013 , 12:06   Re: [TF2] SDKHook_SetTransmit and Miniguns?
Reply With Quote #4

Quote:
Originally Posted by friagram View Post
Setttransmit fires every frame so you are doing tonshit of unneccessary stuff there.
No ridiculous functions are being called, so SetTransmit as it is now seems to be very lightweight, at least the way I'm using it. You're right though, there must be a better way.

Quote:
I think you can just send ef nodraw to the entity effects and it won't be transmitted also
https://developer.valvesoftware.com/wiki/Effects_enum

You can undo it by removing it and marking edict as changed...
How would I go about doing that? Would it only affect visibility for certain other players? I want Friendlies to be visible to other Friendlies, but invisible to Hostiles.

Quote:
Other things you can try is stuff like changing the modelsize to make it very small, and then setting it back to normal, which is also reversable.
Setting the modelsize to be small would not remove unusual effects, nor would it remove footstep sounds. :\ And again, I don't think it would affect only certain other players? I want Friendlies to be visible to other Friendlies, but invisible to Hostiles.

Quote:
Otherwise you can do things like setting the world index to -1
wat

Quote:
or just removing the weaponslot.
Removing the weaponslot is not an option, as that seems to have the unfortunate side effect of removing the weapon.

Last edited by ddhoward; 08-19-2013 at 15:42.
ddhoward is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 08-20-2013 , 09:56   Re: [TF2] SDKHook_SetTransmit and Miniguns?
Reply With Quote #5

On inventory application add in the bit for ef_nodraw to effects then. I think its like m_ieffects or something, then just remove the bit when you are done.
Then mark edict as changed, you only need to change/update the effects offset.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 08-20-2013 at 09:57.
friagram is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 08-20-2013 , 15:37   Re: [TF2] SDKHook_SetTransmit and Miniguns?
Reply With Quote #6

Quote:
Originally Posted by friagram View Post
On inventory application add in the bit for ef_nodraw to effects then. I think its like m_ieffects or something, then just remove the bit when you are done.
Then mark edict as changed, you only need to change/update the effects offset.
How do I specify which clients to apply this to? I want a given entity to be visible to certain players, and invisible to others. And how do I update the "effects offset?"

Half the time, whenever you suggest something, I spend an hour on Google trying to decode what you meant. :\

Last edited by ddhoward; 08-20-2013 at 15:55.
ddhoward is offline
Reply


Thread Tools
Display Modes

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 08:42.


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