AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [TF2] SDKHook_SetTransmit and Miniguns? (https://forums.alliedmods.net/showthread.php?t=223873)

ddhoward 08-18-2013 02:06

[TF2] SDKHook_SetTransmit and Miniguns?
 
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

psychonic 08-18-2013 10:21

Re: [TF2] SDKHook_SetTransmit and Miniguns?
 
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.

friagram 08-19-2013 07:36

Re: [TF2] SDKHook_SetTransmit and Miniguns?
 
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.

ddhoward 08-19-2013 12:06

Re: [TF2] SDKHook_SetTransmit and Miniguns?
 
Quote:

Originally Posted by friagram (Post 2017047)
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. :P

friagram 08-20-2013 09:56

Re: [TF2] SDKHook_SetTransmit and Miniguns?
 
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.

ddhoward 08-20-2013 15:37

Re: [TF2] SDKHook_SetTransmit and Miniguns?
 
Quote:

Originally Posted by friagram (Post 2017977)
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. :\


All times are GMT -4. The time now is 16:17.

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