Raised This Month: $ Target: $400
 0% 

Transparent player models when approaching them.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bad Cold Man
Senior Member
Join Date: Apr 2014
Old 08-23-2015 , 15:52   Transparent player models when approaching them.
Reply With Quote #1

Theme: Transparent player models when approaching them.

Exemple on ze_minecraft_adventure_v1_3c: https://img.fotki.yandex.ru/get/6716..._8905d2b9_orig



Where and how I can adjust the transparency of the player models. This is very useful when your teammates when approaching you become transparent but when they are far away the transparency disappears.
__________________
Bad Cold Man is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 09-01-2015 , 11:27   Re: Transparent player models when approaching them.
Reply With Quote #2

ZR doesn't have such dynamic transparencies. I've had this idea too, but never started working on it.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)
rhelgeby is offline
Send a message via MSN to rhelgeby
Bad Cold Man
Senior Member
Join Date: Apr 2014
Old 09-07-2015 , 14:19   Re: Transparent player models when approaching them.
Reply With Quote #3

Quote:
Originally Posted by rhelgeby View Post
ZR doesn't have such dynamic transparencies. I've had this idea too, but never started working on it.
What's ability in this css & csgo.
__________________
Bad Cold Man is offline
Bad Cold Man
Senior Member
Join Date: Apr 2014
Old 09-11-2015 , 01:47   Re: Transparent player models when approaching them.
Reply With Quote #4

Its working. But i do not know "how this working":

http://steamcommunity.com/sharedfile.../?id=516137622

http://steamcommunity.com/sharedfile.../?id=516137656

http://steamcommunity.com/sharedfile.../?id=516137583
__________________

Last edited by Bad Cold Man; 09-11-2015 at 01:47.
Bad Cold Man is offline
Bad Cold Man
Senior Member
Join Date: Apr 2014
Old 11-12-2015 , 23:49   Re: Transparent player models when approaching them.
Reply With Quote #5

Okey! I do it!

Write to file server.cfg command sv_disable_immunity_alpha 1

In the file \csgo\addons\sourcemod\configs\zr\playerclass es.txt the parameter "alpha_initial" change "255" to "100".

Players @ct will be transparent and no plugins are not required.

Now another question. It is possible to make the weapon model transparent when looked at from the side, rather than holding in their hands?
__________________

Last edited by Bad Cold Man; 11-12-2015 at 23:50. Reason: model transparent
Bad Cold Man is offline
SHUFEN
Senior Member
Join Date: Jun 2014
Location: Japan, Tokyo
Old 11-13-2015 , 15:19   Re: Transparent player models when approaching them.
Reply With Quote #6

Of course If all players is transparent there is a problem for game balance.
So I tried this.
It is "SDKHook_SetTransmit" to become most important.

But I have tried many times, It did not work.
Maybe SourceMOD can not handle "SetTransmit" to only some players.
Need use MetaMOD?

Someone can help us anyway? Thx in advance.

Code:
#pragma semicolon 1
#include <sourcemod> 
#include <sdktools> 
#include <sdkhooks> 
#include <clientprefs>

#include <zombiereloaded>

public Plugin:myinfo =
{
	name = "ZR HIDE PLAYER CS:GO",
	author = "",
	description = "",
	version = "1.0",
	url = ""
};

bool:g_bHide[MAXPLAYERS+1][MAXPLAYERS+1]; 
bool:g_hide[MAXPLAYERS+1] = {false,...};
bool:g_hideoptions[MAXPLAYERS+1] = {false,...};


Handle:SecondTimers[MAXPLAYERS+1];

Handle:HidePlayer = INVALID_HANDLE;
char g_hideplayer[MAXPLAYERS+1][8];


//Handle g_hPluginEnabled = INVALID_HANDLE;
//bool g_bPluginEnabled;


public OnPluginStart() 
{
	
	HidePlayer = RegClientCookie("zr hide player", "", CookieAccess_Private);
	
	HookEvent("round_end", EventRoundEnd);
	HookEvent("player_death", Event_OnPlayerDeath, EventHookMode_Pre);
	HookEvent("player_spawn", OnSpawn);
	RegConsoleCmd("sm_hide", Comando);
	RegConsoleCmd("sm_unhide", Comando2);
	
	HookConVarChange(FindConVar("sv_disable_immunity_alpha"), Changed);
	
	SetConVarInt(FindConVar("sv_disable_immunity_alpha"), 1);
	

}


public Changed(Handle:cvar, const String:oldValue[], const String:newValue[])
{
	SetConVarInt(cvar, 1);
}


public OnClientCookiesCached(client)
{
	GetClientCookie(client, HidePlayer, g_hideplayer[client], 8);
}


public Action:OnSpawn(Handle:event, const String:name[], bool:dontBroadcast) 
{
	int client = GetClientOfUserId(GetEventInt(event, "userid"));
	
	if(!ZR_IsClientHuman(client)) return;
	
	
	if(g_hideoptions[client] || (StrEqual(g_hideplayer[client], "true")))
	{
		FakeClientCommand(client, "say  /hide");
	}
}




public Action:Comando(client, args)
{
	
	//reghook[client] = false;
	
	
	if (SecondTimers[client] != INVALID_HANDLE)
	{
		PrintToChat(client, "\x04 \x03[HIDE] \x04You \x05already using \x04Hide Function, Type \x07!unhide \x04for Disable");
		return Plugin_Handled;
	}
	
	if(IsClientInGame(client) && IsPlayerAlive(client) && ZR_IsClientHuman(client))
	{
		g_hide[client] = true;
		g_hideoptions[client] = true;
		
		SecondTimers[client] = CreateTimer(1.5, Pasar, client, TIMER_REPEAT);
		
		FormatEx(g_hideplayer[client], 8, "true" ,g_hideplayer[client]);
		
		PrintToChat(client, "\x04 \x03[HIDE] %s" ,g_hide[client]?" \x04Hide Function is \x02Enabled\x04, Type \x07!unhide \x04for Disable":"\x06Hide Function is \x02Disabled\x06, Type \x07!hide \x06for Enable");
	}
	else
	{
		PrintToChat(client, "\x04 \x03[HIDE] \x04You can use \x07!hide \x04only at Human");
	}
	
	
	return Plugin_Handled;
}

public Action:Comando2(client, args)
{
	g_hide[client] = false;
	g_hideoptions[client] = false;
	
	if (SecondTimers[client] != INVALID_HANDLE)
		KillTimer(SecondTimers[client]);
	SecondTimers[client] = INVALID_HANDLE;	
	
	
	PrintToChat(client, "\x04 \x03[HIDE] \x06Hide Function is \x02Disabled\x06, Type \x07!hide \x06for Enable");
	FormatEx(g_hideplayer[client], 8, "false" ,g_hideplayer[client]);
	
	return Plugin_Handled;
}

public OnClientDisconnect(client)
{
	if(IsFakeClient(client))
		return;
	
	
	
	SetClientCookie(client, HidePlayer, g_hideplayer[client]);
	g_hideplayer[client] = "";
	
	
	
	if (SecondTimers[client] != INVALID_HANDLE)
		KillTimer(SecondTimers[client]);
	SecondTimers[client] = INVALID_HANDLE;
}

public Action:Event_OnPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
	int client = GetClientOfUserId(GetEventInt(event, "userid"));
	
	if (SecondTimers[client] != INVALID_HANDLE)
	{
		KillTimer(SecondTimers[client]);
		SecondTimers[client] = INVALID_HANDLE;
	}
	
	for(new i = 1; i <= MaxClients; i++)
	{
		g_hide[client] = false;
		g_bHide[client][i] = false;
	}
}

public ZR_OnClientInfected(client, attacker, bool:motherInfect, bool:respawnOverride, bool:respawn)
{
	if (SecondTimers[client] != INVALID_HANDLE)
	{
		KillTimer(SecondTimers[client]);
		SecondTimers[client] = INVALID_HANDLE;
	}
	
	for(new i = 1; i <= MaxClients; i++)
	{
		g_bHide[client][i] = false;
	}
	
	g_hide[client] = false;
}

public Action:Pasar(Handle:timer)
{
	for(int i = 1; i <= MaxClients; i++)
	{
		if(IsClientInGame(i) && IsPlayerAlive(i) && ZR_IsClientHuman(i))
			CheckClientOrg(i);
	}
}

CheckClientOrg(Client) 
{
	decl Float:MedicOrigin[3],Float:TargetOrigin[3], Float:Distance;
	GetClientAbsOrigin(Client, MedicOrigin);
	
	for (new X = 1; X <= MaxClients; X++)
	{
		if(X != Client && IsClientInGame(X) && IsPlayerAlive(X) && ZR_IsClientHuman(X))
		{
			GetClientAbsOrigin(X, TargetOrigin);
			Distance = GetVectorDistance(TargetOrigin,MedicOrigin);
			//PrintToChatAll("test")
			if(Distance <= 100.0)
				g_bHide[Client][X] = true;
			else
			g_bHide[Client][X] = false;
			
		}
	}
}

public OnClientPutInServer(client) 
{
	g_hideoptions[client] = false;
	SDKHook(client, SDKHook_SetTransmit, Hook_SetTransmit);
	
	
	
	
	for(new i = 1; i <= MaxClients; i++)
		g_bHide[client][i] = false; 
}



public Action:EventRoundEnd(Handle:event, const String:name[], bool:dontBroadcast) 
{
	for(int client = 1; client <= MaxClients; client++)
	{
		if(IsClientInGame(client) && !IsFakeClient(client))
		{
			if (SecondTimers[client] != INVALID_HANDLE)
			{
				KillTimer(SecondTimers[client]);
			}
			SecondTimers[client] = INVALID_HANDLE;
		}
	}
}

AdjustAlpha(entity)
{
	SetEntityRenderMode (entity, RENDER_TRANSCOLOR);
	SetEntityRenderColor(entity, 255, 255, 255, 80);
}

public Action:Hook_SetTransmit(client1, client2) 
{ 
	new entity = (client1 != client2 && g_hide[client2] && g_bHide[client1][client2]);
	AdjustAlpha(entity);
	
	return Plugin_Continue; 
}
Attached Files
File Type: sp Get Plugin or Get Source (zr_hide.sp - 251 views - 5.6 KB)
SHUFEN is offline
Send a message via Skype™ to SHUFEN
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 11-14-2015 , 00:36   Re: Transparent player models when approaching them.
Reply With Quote #7

Quote:
Originally Posted by SHUFEN.jp View Post
Of course If all players is transparent there is a problem for game balance.
So I tried this.
It is "SDKHook_SetTransmit" to become most important.

But I have tried many times, It did not work.
Maybe SourceMOD can not handle "SetTransmit" to only some players.
Need use MetaMOD?

Someone can help us anyway? Thx in advance.

Code:
#pragma semicolon 1
#include <sourcemod> 
#include <sdktools> 
#include <sdkhooks> 
#include <clientprefs>

#include <zombiereloaded>

public Plugin:myinfo =
{
	name = "ZR HIDE PLAYER CS:GO",
	author = "",
	description = "",
	version = "1.0",
	url = ""
};

bool:g_bHide[MAXPLAYERS+1][MAXPLAYERS+1]; 
bool:g_hide[MAXPLAYERS+1] = {false,...};
bool:g_hideoptions[MAXPLAYERS+1] = {false,...};


Handle:SecondTimers[MAXPLAYERS+1];

Handle:HidePlayer = INVALID_HANDLE;
char g_hideplayer[MAXPLAYERS+1][8];


//Handle g_hPluginEnabled = INVALID_HANDLE;
//bool g_bPluginEnabled;


public OnPluginStart() 
{
	
	HidePlayer = RegClientCookie("zr hide player", "", CookieAccess_Private);
	
	HookEvent("round_end", EventRoundEnd);
	HookEvent("player_death", Event_OnPlayerDeath, EventHookMode_Pre);
	HookEvent("player_spawn", OnSpawn);
	RegConsoleCmd("sm_hide", Comando);
	RegConsoleCmd("sm_unhide", Comando2);
	
	HookConVarChange(FindConVar("sv_disable_immunity_alpha"), Changed);
	
	SetConVarInt(FindConVar("sv_disable_immunity_alpha"), 1);
	

}


public Changed(Handle:cvar, const String:oldValue[], const String:newValue[])
{
	SetConVarInt(cvar, 1);
}


public OnClientCookiesCached(client)
{
	GetClientCookie(client, HidePlayer, g_hideplayer[client], 8);
}


public Action:OnSpawn(Handle:event, const String:name[], bool:dontBroadcast) 
{
	int client = GetClientOfUserId(GetEventInt(event, "userid"));
	
	if(!ZR_IsClientHuman(client)) return;
	
	
	if(g_hideoptions[client] || (StrEqual(g_hideplayer[client], "true")))
	{
		FakeClientCommand(client, "say  /hide");
	}
}




public Action:Comando(client, args)
{
	
	//reghook[client] = false;
	
	
	if (SecondTimers[client] != INVALID_HANDLE)
	{
		PrintToChat(client, "\x04 \x03[HIDE] \x04You \x05already using \x04Hide Function, Type \x07!unhide \x04for Disable");
		return Plugin_Handled;
	}
	
	if(IsClientInGame(client) && IsPlayerAlive(client) && ZR_IsClientHuman(client))
	{
		g_hide[client] = true;
		g_hideoptions[client] = true;
		
		SecondTimers[client] = CreateTimer(1.5, Pasar, client, TIMER_REPEAT);
		
		FormatEx(g_hideplayer[client], 8, "true" ,g_hideplayer[client]);
		
		PrintToChat(client, "\x04 \x03[HIDE] %s" ,g_hide[client]?" \x04Hide Function is \x02Enabled\x04, Type \x07!unhide \x04for Disable":"\x06Hide Function is \x02Disabled\x06, Type \x07!hide \x06for Enable");
	}
	else
	{
		PrintToChat(client, "\x04 \x03[HIDE] \x04You can use \x07!hide \x04only at Human");
	}
	
	
	return Plugin_Handled;
}

public Action:Comando2(client, args)
{
	g_hide[client] = false;
	g_hideoptions[client] = false;
	
	if (SecondTimers[client] != INVALID_HANDLE)
		KillTimer(SecondTimers[client]);
	SecondTimers[client] = INVALID_HANDLE;	
	
	
	PrintToChat(client, "\x04 \x03[HIDE] \x06Hide Function is \x02Disabled\x06, Type \x07!hide \x06for Enable");
	FormatEx(g_hideplayer[client], 8, "false" ,g_hideplayer[client]);
	
	return Plugin_Handled;
}

public OnClientDisconnect(client)
{
	if(IsFakeClient(client))
		return;
	
	
	
	SetClientCookie(client, HidePlayer, g_hideplayer[client]);
	g_hideplayer[client] = "";
	
	
	
	if (SecondTimers[client] != INVALID_HANDLE)
		KillTimer(SecondTimers[client]);
	SecondTimers[client] = INVALID_HANDLE;
}

public Action:Event_OnPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
	int client = GetClientOfUserId(GetEventInt(event, "userid"));
	
	if (SecondTimers[client] != INVALID_HANDLE)
	{
		KillTimer(SecondTimers[client]);
		SecondTimers[client] = INVALID_HANDLE;
	}
	
	for(new i = 1; i <= MaxClients; i++)
	{
		g_hide[client] = false;
		g_bHide[client][i] = false;
	}
}

public ZR_OnClientInfected(client, attacker, bool:motherInfect, bool:respawnOverride, bool:respawn)
{
	if (SecondTimers[client] != INVALID_HANDLE)
	{
		KillTimer(SecondTimers[client]);
		SecondTimers[client] = INVALID_HANDLE;
	}
	
	for(new i = 1; i <= MaxClients; i++)
	{
		g_bHide[client][i] = false;
	}
	
	g_hide[client] = false;
}

public Action:Pasar(Handle:timer)
{
	for(int i = 1; i <= MaxClients; i++)
	{
		if(IsClientInGame(i) && IsPlayerAlive(i) && ZR_IsClientHuman(i))
			CheckClientOrg(i);
	}
}

CheckClientOrg(Client) 
{
	decl Float:MedicOrigin[3],Float:TargetOrigin[3], Float:Distance;
	GetClientAbsOrigin(Client, MedicOrigin);
	
	for (new X = 1; X <= MaxClients; X++)
	{
		if(X != Client && IsClientInGame(X) && IsPlayerAlive(X) && ZR_IsClientHuman(X))
		{
			GetClientAbsOrigin(X, TargetOrigin);
			Distance = GetVectorDistance(TargetOrigin,MedicOrigin);
			//PrintToChatAll("test")
			if(Distance <= 100.0)
				g_bHide[Client][X] = true;
			else
			g_bHide[Client][X] = false;
			
		}
	}
}

public OnClientPutInServer(client) 
{
	g_hideoptions[client] = false;
	SDKHook(client, SDKHook_SetTransmit, Hook_SetTransmit);
	
	
	
	
	for(new i = 1; i <= MaxClients; i++)
		g_bHide[client][i] = false; 
}



public Action:EventRoundEnd(Handle:event, const String:name[], bool:dontBroadcast) 
{
	for(int client = 1; client <= MaxClients; client++)
	{
		if(IsClientInGame(client) && !IsFakeClient(client))
		{
			if (SecondTimers[client] != INVALID_HANDLE)
			{
				KillTimer(SecondTimers[client]);
			}
			SecondTimers[client] = INVALID_HANDLE;
		}
	}
}

AdjustAlpha(entity)
{
	SetEntityRenderMode (entity, RENDER_TRANSCOLOR);
	SetEntityRenderColor(entity, 255, 255, 255, 80);
}

public Action:Hook_SetTransmit(client1, client2) 
{ 
	new entity = (client1 != client2 && g_hide[client2] && g_bHide[client1][client2]);
	AdjustAlpha(entity);
	
	return Plugin_Continue; 
}
much of that code was written by me, especially since it has written parts in my language (spanish).


And SDKHook_SetTransmit ofcourse that works well.


Here I leave the original plugin.
PHP Code:
#include <sourcemod> 
#include <sdktools> 
#include <sdkhooks> 
#include <zombiereloaded>

#define PLUGIN_VERSION "1.0" 

new bool:g_bHide[MAXPLAYERS+1][MAXPLAYERS+1]; 
new 
bool:g_hide[MAXPLAYERS+1]; 

public 
Plugin:myinfo =  

    
name "SM Hide Teammates For Proximity"
    
author "Franc1sco franug"
    
description ""
    
version PLUGIN_VERSION
    
url "www.steamcommunity.com/id/franug/" 


public 
OnPluginStart() 

    
CreateTimer(0.5Pasar_TIMER_REPEAT);
    
    
HookEvent("player_death"Event_OnPlayerDeathEventHookMode_Pre);
    
    
RegConsoleCmd("sm_hide"Comando);
}

public 
Action:Comando(clientargs)
{
    
g_hide[client] = !g_hide[client];
    
PrintToChat(client"Hide feature %s" ,g_hide[client]?"Activated":"Desactivated");

    return 
Plugin_Handled;
}

public 
Action:Event_OnPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    for(new 
1<= MaxClientsi++)
        
g_bHide[client][i] = false
}

public 
ZR_OnClientInfected(clientattackerbool:motherInfectbool:respawnOverridebool:respawn)
{
    for(new 
1<= MaxClientsi++)
        
g_bHide[client][i] = false
}

public 
Action:Pasar(Handle:timer)
{
    for(new 
1<= MaxClientsi++)
        if(
IsClientInGame(i) && IsPlayerAlive(i) && ZR_IsClientHuman(i))
            
CheckClientOrg(i);

}

CheckClientOrg(Client
{
    
decl Float:MedicOrigin[3],Float:TargetOrigin[3], Float:Distance;
    
GetClientAbsOrigin(ClientMedicOrigin);
    for (new 
1<= MaxClientsX++)
    {
        if(
!= Client && IsClientInGame(X) && IsPlayerAlive(X) && ZR_IsClientHuman(X))
        {
            
GetClientAbsOrigin(XTargetOrigin);
            
Distance GetVectorDistance(TargetOrigin,MedicOrigin);
            if(
Distance <= 100.0)
                
g_bHide[Client][X] = true;
            else
                
g_bHide[Client][X] = false;
        }
    }
}

public 
OnClientPutInServer(client

    
g_hide[client] = true;
    for(new 
1<= MaxClientsi++)
        
g_bHide[client][i] = false
        
    
    
SDKHook(clientSDKHook_SetTransmitHook_SetTransmit); 


public 
Action:Hook_SetTransmit(client1client2

    if (
client1 != client2 && g_hide[client2] && g_bHide[client1][client2]) 
        return 
Plugin_Handled;
     
    return 
Plugin_Continue


Quote:
Originally Posted by Bad Cold Man View Post
This is very useful when your teammates when approaching you become transparent but when they are far away the transparency disappears.
I can make it easily (and for free) if someone can help me to test it with a server with people (add me in steam).
Attached Files
File Type: sp Get Plugin or Get Source (zr_hider.sp - 233 views - 2.3 KB)
File Type: smx zr_hider.smx (5.7 KB, 329 views)
__________________
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.


Last edited by Franc1sco; 11-14-2015 at 02:51.
Franc1sco is offline
Send a message via MSN to Franc1sco
Bad Cold Man
Senior Member
Join Date: Apr 2014
Old 11-14-2015 , 05:19   Re: Transparent player models when approaching them.
Reply With Quote #8

Quote:
Originally Posted by Franc1sco View Post
much of that code was written by me, especially since it has written parts in my language (spanish).


And SDKHook_SetTransmit ofcourse that works well.


Here I leave the original plugin.
PHP Code:
#include <sourcemod> 
#include <sdktools> 
#include <sdkhooks> 
#include <zombiereloaded>

#define PLUGIN_VERSION "1.0" 

new bool:g_bHide[MAXPLAYERS+1][MAXPLAYERS+1]; 
new 
bool:g_hide[MAXPLAYERS+1]; 

public 
Plugin:myinfo =  

    
name "SM Hide Teammates For Proximity"
    
author "Franc1sco franug"
    
description ""
    
version PLUGIN_VERSION
    
url "www.steamcommunity.com/id/franug/" 


public 
OnPluginStart() 

    
CreateTimer(0.5Pasar_TIMER_REPEAT);
    
    
HookEvent("player_death"Event_OnPlayerDeathEventHookMode_Pre);
    
    
RegConsoleCmd("sm_hide"Comando);
}

public 
Action:Comando(clientargs)
{
    
g_hide[client] = !g_hide[client];
    
PrintToChat(client"Hide feature %s" ,g_hide[client]?"Activated":"Desactivated");

    return 
Plugin_Handled;
}

public 
Action:Event_OnPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    for(new 
1<= MaxClientsi++)
        
g_bHide[client][i] = false
}

public 
ZR_OnClientInfected(clientattackerbool:motherInfectbool:respawnOverridebool:respawn)
{
    for(new 
1<= MaxClientsi++)
        
g_bHide[client][i] = false
}

public 
Action:Pasar(Handle:timer)
{
    for(new 
1<= MaxClientsi++)
        if(
IsClientInGame(i) && IsPlayerAlive(i) && ZR_IsClientHuman(i))
            
CheckClientOrg(i);

}

CheckClientOrg(Client
{
    
decl Float:MedicOrigin[3],Float:TargetOrigin[3], Float:Distance;
    
GetClientAbsOrigin(ClientMedicOrigin);
    for (new 
1<= MaxClientsX++)
    {
        if(
!= Client && IsClientInGame(X) && IsPlayerAlive(X) && ZR_IsClientHuman(X))
        {
            
GetClientAbsOrigin(XTargetOrigin);
            
Distance GetVectorDistance(TargetOrigin,MedicOrigin);
            if(
Distance <= 100.0)
                
g_bHide[Client][X] = true;
            else
                
g_bHide[Client][X] = false;
        }
    }
}

public 
OnClientPutInServer(client

    
g_hide[client] = true;
    for(new 
1<= MaxClientsi++)
        
g_bHide[client][i] = false
        
    
    
SDKHook(clientSDKHook_SetTransmitHook_SetTransmit); 


public 
Action:Hook_SetTransmit(client1client2

    if (
client1 != client2 && g_hide[client2] && g_bHide[client1][client2]) 
        return 
Plugin_Handled;
     
    return 
Plugin_Continue




I can make it easily (and for free) if someone can help me to test it with a server with people (add me in steam).
I've made a small change, because sm_hide already in use in another plugin.
PHP Code:

#include <sourcemod> 
#include <sdktools> 
#include <sdkhooks> 
#include <zombiereloaded>

#define PLUGIN_VERSION "1.0" 

new bool:g_bHider[MAXPLAYERS+1][MAXPLAYERS+1]; 
new 
bool:g_hider[MAXPLAYERS+1]; 

public 
Plugin:myinfo =  

    
name "SM Hider Teammates For Proximity"
    
author "Franc1sco franug"
    
description ""
    
version PLUGIN_VERSION
    
url "www.steamcommunity.com/id/franug/" 


public 
OnPluginStart() 

    
CreateTimer(0.5Pasar_TIMER_REPEAT);
    
    
HookEvent("player_death"Event_OnPlayerDeathEventHookMode_Pre);
    
    
RegConsoleCmd("sm_hider"Comando);
}

public 
Action:Comando(clientargs)
{
    
g_hider[client] = !g_hider[client];
    
PrintToChat(client"Hider feature %s" ,g_hider[client]?"Activated":"Desactivated");

    return 
Plugin_Handled;
}

public 
Action:Event_OnPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    for(new 
1<= MaxClientsi++)
        
g_bHider[client][i] = false
}

public 
ZR_OnClientInfected(clientattackerbool:motherInfectbool:respawnOverridebool:respawn)
{
    for(new 
1<= MaxClientsi++)
        
g_bHider[client][i] = false
}

public 
Action:Pasar(Handle:timer)
{
    for(new 
1<= MaxClientsi++)
        if(
IsClientInGame(i) && IsPlayerAlive(i) && ZR_IsClientHuman(i))
            
CheckClientOrg(i);

}

CheckClientOrg(Client
{
    
decl Float:MedicOrigin[3],Float:TargetOrigin[3], Float:Distance;
    
GetClientAbsOrigin(ClientMedicOrigin);
    for (new 
1<= MaxClientsX++)
    {
        if(
!= Client && IsClientInGame(X) && IsPlayerAlive(X) && ZR_IsClientHuman(X))
        {
            
GetClientAbsOrigin(XTargetOrigin);
            
Distance GetVectorDistance(TargetOrigin,MedicOrigin);
            if(
Distance <= 100.0)
                
g_bHider[Client][X] = true;
            else
                
g_bHider[Client][X] = false;
        }
    }
}

public 
OnClientPutInServer(client

    
g_hider[client] = true;
    for(new 
1<= MaxClientsi++)
        
g_bHider[client][i] = false
        
    
    
SDKHook(clientSDKHook_SetTransmitHook_SetTransmit); 


public 
Action:Hook_SetTransmit(client1client2

    if (
client1 != client2 && g_hider[client2] && g_bHider[client1][client2]) 
        return 
Plugin_Handled;
     
    return 
Plugin_Continue

__________________
Bad Cold Man is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 11-14-2015 , 05:33   Re: Transparent player models when approaching them.
Reply With Quote #9

Quote:
Originally Posted by Bad Cold Man View Post
I've made a small change, because sm_hide already in use in another plugin.
PHP Code:

#include <sourcemod> 
#include <sdktools> 
#include <sdkhooks> 
#include <zombiereloaded>

#define PLUGIN_VERSION "1.0" 

new bool:g_bHider[MAXPLAYERS+1][MAXPLAYERS+1]; 
new 
bool:g_hider[MAXPLAYERS+1]; 

public 
Plugin:myinfo =  

    
name "SM Hider Teammates For Proximity"
    
author "Franc1sco franug"
    
description ""
    
version PLUGIN_VERSION
    
url "www.steamcommunity.com/id/franug/" 


public 
OnPluginStart() 

    
CreateTimer(0.5Pasar_TIMER_REPEAT);
    
    
HookEvent("player_death"Event_OnPlayerDeathEventHookMode_Pre);
    
    
RegConsoleCmd("sm_hider"Comando);
}

public 
Action:Comando(clientargs)
{
    
g_hider[client] = !g_hider[client];
    
PrintToChat(client"Hider feature %s" ,g_hider[client]?"Activated":"Desactivated");

    return 
Plugin_Handled;
}

public 
Action:Event_OnPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    for(new 
1<= MaxClientsi++)
        
g_bHider[client][i] = false
}

public 
ZR_OnClientInfected(clientattackerbool:motherInfectbool:respawnOverridebool:respawn)
{
    for(new 
1<= MaxClientsi++)
        
g_bHider[client][i] = false
}

public 
Action:Pasar(Handle:timer)
{
    for(new 
1<= MaxClientsi++)
        if(
IsClientInGame(i) && IsPlayerAlive(i) && ZR_IsClientHuman(i))
            
CheckClientOrg(i);

}

CheckClientOrg(Client
{
    
decl Float:MedicOrigin[3],Float:TargetOrigin[3], Float:Distance;
    
GetClientAbsOrigin(ClientMedicOrigin);
    for (new 
1<= MaxClientsX++)
    {
        if(
!= Client && IsClientInGame(X) && IsPlayerAlive(X) && ZR_IsClientHuman(X))
        {
            
GetClientAbsOrigin(XTargetOrigin);
            
Distance GetVectorDistance(TargetOrigin,MedicOrigin);
            if(
Distance <= 100.0)
                
g_bHider[Client][X] = true;
            else
                
g_bHider[Client][X] = false;
        }
    }
}

public 
OnClientPutInServer(client

    
g_hider[client] = true;
    for(new 
1<= MaxClientsi++)
        
g_bHider[client][i] = false
        
    
    
SDKHook(clientSDKHook_SetTransmitHook_SetTransmit); 


public 
Action:Hook_SetTransmit(client1client2

    if (
client1 != client2 && g_hider[client2] && g_bHider[client1][client2]) 
        return 
Plugin_Handled;
     
    return 
Plugin_Continue

So you use my plugin now?

As I said, I can make that change only transparency of players (dynamic transparencies) instead of dissapear him completly (without use settransmit that also will be more optimized ). You can help me with the testing in steam if you want a better version of this plugin.
__________________
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.


Last edited by Franc1sco; 11-14-2015 at 05:35.
Franc1sco is offline
Send a message via MSN to Franc1sco
Bad Cold Man
Senior Member
Join Date: Apr 2014
Old 11-14-2015 , 05:39   Re: Transparent player models when approaching them.
Reply With Quote #10

Quote:
Originally Posted by poel View Post
it works ? not for me.

Even with sv_disable_immunity_alpha 1
It works on my server.


Quote:
Originally Posted by Franc1sco View Post
So you use my plugin now?

As I said, I can make that change only transparency of players (dynamic transparencies) instead of dissapear him completly (without use settransmit that also will be more optimized ). You can help me with the testing in steam if you want a better version of this plugin.

Yes. I use ur plugin. I added you in steam for a very long time.
__________________
Bad Cold Man 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 12:43.


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