Raised This Month: $51 Target: $400
 12% 

[Not Solved anymore][CS:GO] Knife it's still visible


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
valio_skull
Senior Member
Join Date: Jan 2013
Location: at home
Old 12-31-2015 , 05:54   [Not Solved anymore][CS:GO] Knife it's still visible
Reply With Quote #1

Hello, I have this code (makes the terrorist invisible when he is holding a knife), it works BUT the knife it's still visible
PHP Code:
    char wepname[32];
    
GetClientWeapon(clientwepnamesizeof(wepname));
    
int flags GetEntityFlags(client);
    
bool CanBePlayerInvisible IsPlayerNotMoving(buttons) && !IsPlayerInAir(flagsclient) && StrEqual(wepname"weapon_knife");
    if (
CanBePlayerInvisible)
    {
        if (
GetClientTeam(client) == CS_TEAM_T)
        {
            if(!
IsPlayerInvisible[client])
            {
                
FadeClient(client75,0,130,35);
                if(!
IsPlayerComingToInvisible[client])
                {
                    
PlayerInvisTime[client] = GetGameTime();
                    
IsPlayerComingToInvisible[client] = true;
                }
                else if(
IsPlayerComingToInvisible[client])
                {
                    if(
IsValidClient(clienttrue) && GetClientTeam(client) == CS_TEAM_T && !IsPlayerInvisible[client])
                    {
                        
int color[MAXPLAYERS+1][4];
                        
Entity_GetRenderColor(client,color[client]);
                        
float time 0.01;
                        
float timeleft[MAXPLAYERS+1];
                        
timeleft[client] = PlayerInvisTime[client] - GetGameTime() + time;
                        if(
timeleft[client] < 0.01 && (color[client][3] - 26) <= )
                        {
                            
Entity_SetRenderColor(client,-1,-1,-1,0);
                            
SetClientWeaponsVisibility(clientfalse);
                            
FadeClient(client35,0,130,60);
                            
IsPlayerInvisible[client] = true;
                        }
                        else if(
timeleft[client] < 0.01 && color[client][3] > 1)
                        {
                            
Entity_SetRenderColor(client,-1,-1,-1,color[client][3]-26);
                            
SetClientWeaponsVisibility(client,color[client][3]-26);
                            
PlayerInvisTime[client] = GetGameTime();
                        }
                    }
                }
            }
        }
    } 
THIS is a screenshot with me in THIRDPERSON.
PS: The code is not mine, I got it from one of ESK0's private plugins.
__________________

Last edited by valio_skull; 07-21-2016 at 11:20. Reason: not solved
valio_skull is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 12-31-2015 , 08:39   Re: [CS:GO] Knife it's still visible
Reply With Quote #2

Yeah i've been having the same issues with setting the alpha/rendermode of weapons that are active. Not even on weapon switch does the rendermode change.
Mitchell is offline
valio_skull
Senior Member
Join Date: Jan 2013
Location: at home
Old 01-01-2016 , 10:45   Re: [CS:GO] Knife it's still visible
Reply With Quote #3

Quote:
Originally Posted by Mitchell View Post
Yeah i've been having the same issues with setting the alpha/rendermode of weapons that are active. Not even on weapon switch does the rendermode change.
Any way to fix it ?
__________________
valio_skull is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 01-01-2016 , 12:06   Re: [CS:GO] Knife it's still visible
Reply With Quote #4

I had some weird results when ever I hooked WeaponDrop on the player (sdkhooks) and blocking the weapon drop makes the weapon go invisible. So maybe the entity needs updated after setting the render color.
Mitchell is offline
zoubiey
Member
Join Date: Jul 2009
Location: Sweden / Piteå
Old 01-02-2016 , 11:12   Re: [CS:GO] Knife it's still visible
Reply With Quote #5

Don't know if this would help you at all, but you could check out the code in BlockBuilder which has a stealth block.
zoubiey is offline
valio_skull
Senior Member
Join Date: Jan 2013
Location: at home
Old 01-03-2016 , 16:45   Re: [Solved][CS:GO] Knife it's still visible
Reply With Quote #6

-Solved-
It was a bug with the rest of the code
That code was like "If player is visible, make weapon visible. If player is invisible, make weapon visible"...
__________________

Last edited by valio_skull; 01-03-2016 at 16:46.
valio_skull is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 01-03-2016 , 17:42   Re: [Solved][CS:GO] Knife it's still visible
Reply With Quote #7

Can you post the code that makes the weapon invisible?
PartialCloning is offline
valio_skull
Senior Member
Join Date: Jan 2013
Location: at home
Old 01-04-2016 , 05:23   Re: [Solved][CS:GO] Knife it's still visible
Reply With Quote #8

Quote:
Originally Posted by PartialCloning View Post
Can you post the code that makes the weapon invisible?


PHP Code:
    //////////////////////// Invisible ////////////////////////
    
char wepname[32];
    
GetClientWeapon(clientwepnamesizeof(wepname));
    
int flags GetEntityFlags(client);
    
bool CanBePlayerInvisible IsPlayerNotMoving(buttons) && !IsPlayerInAir(flagsclient) && StrEqual(wepname"weapon_knife");
    if (
CanBePlayerInvisible)
    {
        if (
GetClientTeam(client) == CS_TEAM_T)
        {
            if(!
IsPlayerInvisible[client])
            {
                
FadeClient(client75,0,130,35);
                if(!
IsPlayerComingToInvisible[client])
                {
                    
PlayerInvisTime[client] = GetGameTime();
                    
IsPlayerComingToInvisible[client] = true;
                }
                else if(
IsPlayerComingToInvisible[client])
                {
                    if(
IsValidClient(clienttrue) && GetClientTeam(client) == CS_TEAM_T && !IsPlayerInvisible[client])
                    {
                        
int color[MAXPLAYERS+1][4];
                        
Entity_GetRenderColor(client,color[client]);
                        
float time 0.01;
                        
float timeleft[MAXPLAYERS+1];
                        
timeleft[client] = PlayerInvisTime[client] - GetGameTime() + time;
                        if(
timeleft[client] < 0.01 && (color[client][3] - 26) <= )
                        {
                            
Entity_SetRenderColor(client,-1,-1,-1,0);
                            
SetClientWeaponsVisibility(clientfalse);
                            
FadeClient(client35,0,130,60);
                            
IsPlayerInvisible[client] = true;
                        }
                        else if(
timeleft[client] < 0.01 && color[client][3] > 1)
                        {
                            
Entity_SetRenderColor(client,-1,-1,-1,color[client][3]-26);
                            
SetClientWeaponsVisibility(client,color[client][3]-26);
                            
PlayerInvisTime[client] = GetGameTime();
                        }
                    }
                }
            }
        }
    }
    else
    {
        if(
GetClientTeam(client) == CS_TEAM_T)
        {
//            SetClientWeaponsVisibility(client, false);   // HERE, I disabled this line...wtf
            
FadeClient(client75,0,130,35);
        }
        
Entity_SetRenderColor(client,-1,-1,-1,255);
        
IsPlayerComingToInvisible[client] = false;
        
IsPlayerInvisible[client] = false;
    } 
__________________

Last edited by valio_skull; 01-04-2016 at 05:25.
valio_skull is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 01-04-2016 , 07:28   Re: [Solved][CS:GO] Knife it's still visible
Reply With Quote #9

PHP Code:
SetClientWeaponsVisibility(clientfalse); 
So that part is what makes the world knife model invisible? Can you post that function or link to the plugin you got it from?
PartialCloning is offline
valio_skull
Senior Member
Join Date: Jan 2013
Location: at home
Old 01-09-2016 , 10:04   Re: [Solved][CS:GO] Knife it's still visible
Reply With Quote #10

Quote:
Originally Posted by PartialCloning View Post
PHP Code:
SetClientWeaponsVisibility(clientfalse); 
So that part is what makes the world knife model invisible? Can you post that function or link to the plugin you got it from?
Quote:
Originally Posted by valio_skull View Post
I got it from one of ESK0's private plugins.
__________________
valio_skull 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 23:42.


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