AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie:Reloaded (https://forums.alliedmods.net/forumdisplay.php?f=132)
-   -   Transparent player models when approaching them. (https://forums.alliedmods.net/showthread.php?t=270554)

Bad Cold Man 08-23-2015 15:52

Transparent player models when approaching them.
 
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.

rhelgeby 09-01-2015 11:27

Re: Transparent player models when approaching them.
 
ZR doesn't have such dynamic transparencies. I've had this idea too, but never started working on it.

Bad Cold Man 09-07-2015 14:19

Re: Transparent player models when approaching them.
 
Quote:

Originally Posted by rhelgeby (Post 2338886)
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 09-11-2015 01:47

Re: Transparent player models when approaching them.
 
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

Bad Cold Man 11-12-2015 23:49

Re: Transparent player models when approaching them.
 
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?

SHUFEN 11-13-2015 15:19

Re: Transparent player models when approaching them.
 
1 Attachment(s)
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;
}


Franc1sco 11-14-2015 00:36

Re: Transparent player models when approaching them.
 
2 Attachment(s)
Quote:

Originally Posted by SHUFEN.jp (Post 2362766)
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 (Post 2336275)
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).

Bad Cold Man 11-14-2015 05:19

Re: Transparent player models when approaching them.
 
Quote:

Originally Posted by Franc1sco (Post 2362915)
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



poel 11-14-2015 05:30

Re: Transparent player models when approaching them.
 
it works ? not for me.

Even with sv_disable_immunity_alpha 1

Franc1sco 11-14-2015 05:33

Re: Transparent player models when approaching them.
 
Quote:

Originally Posted by Bad Cold Man (Post 2362945)
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.


All times are GMT -4. The time now is 12:42.

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