Raised This Month: $32 Target: $400
 8% 

Solved Ts invisible for CTs with SDKHook


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AuricYoutube
Senior Member
Join Date: Aug 2016
Location: Here
Old 11-13-2019 , 06:57   Ts invisible for CTs with SDKHook
Reply With Quote #1

Can someone please make me a plugin where CTs cannot see Ts using this concept

Code:
public void OnClientPutInServer(int client)
{
    SDKHook(client, SDKHook_SetTransmit, Hook_SetTransmit);
}

public Action Hook_SetTransmit(int entity, int client)
{
    if (client != entity && (0 < entity <= MaxClients) && IsPlayerAlive(client)) {
            return Plugin_Handled;
    }
    
    return Plugin_Continue;
}
So like what I want with this is Ts are invisible to CTs but Ts can see each other and CTs.

Thanks

Last edited by AuricYoutube; 11-13-2019 at 10:18.
AuricYoutube is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 11-13-2019 , 07:46   Re: Ts invisible for CTs with SDKHook
Reply With Quote #2

Add
PHP Code:
GetClientTeam(entity) == CS_TEAM_T && GetClientTeam(client) == CS_TEAM_CT 
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.

Franc1sco is offline
Send a message via MSN to Franc1sco
AuricYoutube
Senior Member
Join Date: Aug 2016
Location: Here
Old 11-13-2019 , 10:07   Re: Ts invisible for CTs with SDKHook
Reply With Quote #3

Quote:
#include <sourcemod>
#include <sdkhooks>
#include <cstrike>

public void OnClientPutInServer(int client)
{
SDKHook(client, SDKHook_SetTransmit, Hook_SetTransmit);
}

public Action Hook_SetTransmit(int entity, int client)
{
if (GetClientTeam(entity) == CS_TEAM_T && GetClientTeam(client) == CS_TEAM_CT && client != entity && (0 < entity <= MaxClients) && IsPlayerAlive(client)) {
return Plugin_Handled;
}

return Plugin_Continue;
}
I assume this is the way you do it since I got no errors when compiling, thanks Franc1sco!

Last edited by AuricYoutube; 11-13-2019 at 10:07.
AuricYoutube is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 11-13-2019 , 11:49   Re: Ts invisible for CTs with SDKHook
Reply With Quote #4

Don't check the team or if the player is alive in that function. Use global variables. The sdk transmit function its called every frame.
__________________
Ilusion9 is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 11-16-2019 , 10:53   Re: Ts invisible for CTs with SDKHook
Reply With Quote #5

Quote:
Originally Posted by Ilusion9 View Post
Don't check the team or if the player is alive in that function. Use global variables. The sdk transmit function its called every frame.
Aren't both ways the same to calling a variable?
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 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 04:51.


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