Raised This Month: $90 Target: $400
 22% 

Solved Make weapons behind client invisible


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
farawayf
Member
Join Date: Jan 2019
Old 03-13-2019 , 13:03   Make weapons behind client invisible
Reply With Quote #1

Solved.

PHP Code:

        
new weapons FindSendPropOffs("CBasePlayer""m_hMyWeapons");    
        for(new 
0weapon47+= 4
        { 
            
weapon GetEntDataEnt2(clientweapons i); 
            if(
weapon > -
            { 
                
SetEntityRenderMode(weaponRENDER_NONE); 
                
SetEntityRenderColor(weapon0000); 
            } 
        } 

Last edited by farawayf; 03-14-2019 at 13:38.
farawayf is offline
MasterMind420
Veteran Member
Join Date: Nov 2010
Old 03-13-2019 , 15:10   Re: Make weapons behind client invisible
Reply With Quote #2

You have to use sdkhooks SetTransmit...there's plenty of info here on allied modders on how to use it.
MasterMind420 is offline
farawayf
Member
Join Date: Jan 2019
Old 03-13-2019 , 15:27   Re: Make weapons behind client invisible
Reply With Quote #3

Quote:
Originally Posted by MasterMind420 View Post
You have to use sdkhooks SetTransmit...there's plenty of info here on allied modders on how to use it.
The players becomes visible on some maps due some spheres which sets the mappers

Last edited by farawayf; 03-13-2019 at 15:27.
farawayf is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 03-14-2019 , 12:19   Re: Make weapons behind client invisible
Reply With Quote #4

Quote:
Originally Posted by farawayf View Post
The players becomes visible on some maps due some spheres which sets the mappers
How does it even work? How about using Stripper:Source to remove all those spheres?
__________________
Accepting private work. Contact me if you're interested.
If you like my work, feel free to donate in appreciation with PayPal or CSGO Skins.

Total Donated: 10$
eyal282 is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 03-14-2019 , 15:12   Re: Make weapons behind client invisible
Reply With Quote #5

Wasn't the solution also setting the m_iAddonBits or whatever?
__________________
Mitchell is offline
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 03-14-2019 , 15:13   Re: Make weapons behind client invisible
Reply With Quote #6

https://forums.alliedmods.net/showthread.php?t=152165
Indarello is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 03-14-2019 , 15:23   Re: Make weapons behind client invisible
Reply With Quote #7

Found this snippet in one of my old repos:

Code:
public void OnPostThinkPost(int client) {
	if(isMonster(client)) {
		SetEntProp(client, Prop_Send, "m_iAddonBits", 0);
	}
}
I'd say if setting the render color of the weapon works, use that. That way you're not setting this prop on a Think callback.
__________________
Mitchell is offline
farawayf
Member
Join Date: Jan 2019
Old 03-14-2019 , 15:31   Re: Make weapons behind client invisible
Reply With Quote #8

Quote:
Originally Posted by Mitchell View Post
Found this snippet in one of my old repos:

Code:
public void OnPostThinkPost(int client) {
	if(isMonster(client)) {
		SetEntProp(client, Prop_Send, "m_iAddonBits", 0);
	}
}
I'd say if setting the render color of the weapon works, use that. That way you're not setting this prop on a Think callback.

PHP Code:
public Action:m_invisible(clientarg)  
{
    ...................................


    
alpha(client0); 
    
SetEntityRenderMode(clientRENDER_NONE); 
    
SetEntityRenderColor(client0,0,0,0); 

    
    
SDKHook(clientSDKHook_PostThinkPostOnPostThinkPost);
    
CreateTimer(5.0m_visibleclient);
    return 
Plugin_Continue;
}

alpha(clientalpha
{        
    
winvis(client,alpha); 


winvis(clientalpha

    if(
IsPlayerAlive(client)) 
    { 
        new 
weapons FindSendPropOffs("CBasePlayer""m_hMyWeapons");    
        for(new 
0weapon47+= 4
        { 
            
weapon GetEntDataEnt2(clientweapons i); 
            if(
weapon > -
            { 
                
SetEntityRenderMode(weaponRENDER_TRANSCOLOR); 
                
SetEntityRenderColor(weapon255255255alpha); 
            } 
        } 
    } 
}  

public 
Action m_visible(Handle timerany:client)
{
    
alpha(client255); 
    
SetEntityRenderMode(clientRENDER_TRANSCOLOR); 
    
SetEntityRenderColor(client255,255,255,255);
    
    
SDKUnhook(clientSDKHook_PostThinkPostOnPostThinkPost);
}
    
public 
OnPostThinkPost(clientSetEntProp(clientProp_Send"m_iAddonBits"0); 
?
farawayf is offline
Reply


Thread Tools
Display Modes

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 20:31.


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