Raised This Month: $ Target: $400
 0% 

Transparent player models when approaching them.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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


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