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

TF2 HELP - Making a player fully invisible


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NeoDement
Member
Join Date: Mar 2009
Old 03-14-2009 , 16:27   TF2 HELP - Making a player fully invisible
Reply With Quote #1

Here's what I've got so far
Code:
    //No longer render the player
    SetEntityRenderMode(target, RENDER_NONE);
This works perfectly, except for one thing; You can still see their weapon!

Any one got any idea how to hide that too?

(ooh yes and sorry if this is the wrong section, I saw a few other help threads in this section and thought I should just go for it)
NeoDement is offline
Chris-_-
SourceMod Donor
Join Date: Oct 2008
Old 03-14-2009 , 17:26   Re: TF2 HELP - Making a player fully invisible
Reply With Quote #2

From FunCommandsX:

PHP Code:
SetWeaponsRGBA(clientRenderMode:mode)
{
    new 
m_hMyWeapons FindSendPropOffs(g_PlayerProperty"m_hMyWeapons");    

    for(new 
0weapon47+= 4)
    {
        
weapon GetEntDataEnt2(clientm_hMyWeapons i);
    
        if(
weapon > -)
        {
            
SetEntityRenderMode(weaponmode);
            
SetEntityRenderColor(weapong_PlayerColor[client][0], g_PlayerColor[client][1], g_PlayerColor[client][2], g_PlayerColor[client][3]);
        }
    }

Chris-_- is offline
NeoDement
Member
Join Date: Mar 2009
Old 03-14-2009 , 17:38   Re: TF2 HELP - Making a player fully invisible
Reply With Quote #3

Undefined symbol "g_PlayerProperty"

It raises a good point, what is "g_PlayerProperty" supposed to be?
NeoDement is offline
retsam
Veteran Member
Join Date: Aug 2008
Location: so-cal
Old 03-14-2009 , 17:42   Re: TF2 HELP - Making a player fully invisible
Reply With Quote #4

This is already done, you dont need to waste time coding it yerself unless you feel like it lol.

This is from rtd plugin, slightly different from what he posted. It works.


Code:
// Invisiablilty brought to you by Spazman0
CreateInvis(target)    
{
    SetAlpha(target,0);
}

SetAlpha(target, alpha)
{        
    SetWeaponsAlpha(target,alpha);
    SetEntityRenderMode(target, RENDER_TRANSCOLOR);
    SetEntityRenderColor(target, 255, 255, 255, alpha);    
}

SetWeaponsAlpha(target, alpha)
{
        if(IsPlayerAlive(target))
        {
            new m_hMyWeapons = FindSendPropOffs("CBasePlayer", "m_hMyWeapons");    
        
            for(new i = 0, weapon; i < 47; i += 4)
            {
                weapon = GetEntDataEnt2(target, m_hMyWeapons + i);
            
                if(weapon > -1 )
                {
                    SetEntityRenderMode(weapon, RENDER_TRANSCOLOR);
                    SetEntityRenderColor(weapon, 255, 255, 255, alpha);
                }
            }
        }
}
retsam is offline
NeoDement
Member
Join Date: Mar 2009
Old 03-14-2009 , 17:48   Re: TF2 HELP - Making a player fully invisible
Reply With Quote #5

Edit: Okay I've worked out my specific problem, RENDER_NONE is glitchy. The only way that works 100% of the time is setting them to be fully transparent. A bit less efficient but what do I care

Last edited by NeoDement; 03-14-2009 at 18:22.
NeoDement is offline
teddyruxpin
Overseer of lost packets
Join Date: Feb 2008
Old 03-14-2009 , 22:20   Re: TF2 HELP - Making a player fully invisible
Reply With Quote #6

Why not use "sm_alpha playername 0" ? This will make you fully invisible unless your using partymode which will still show the party cap.

-Teddy
__________________
Black Tusk Labs Home of Turbo TF2 and Turbo L4D:
http://blacktusklabs.com/ - Mah blog and stuff

My Crappy Plugins: SuperBuilds, Parent Buildables,
L4D Player Info
teddyruxpin is offline
NeoDement
Member
Join Date: Mar 2009
Old 03-14-2009 , 23:32   Re: TF2 HELP - Making a player fully invisible
Reply With Quote #7

Ah, because I didn't know about it. I'll give that a shot ;)

edit: uh sm_alpha is an undefined symbol, am I meant to run it as a convar? And if so, I think my way's probably better...

Last edited by NeoDement; 03-14-2009 at 23:36.
NeoDement is offline
Chris-_-
SourceMod Donor
Join Date: Oct 2008
Old 03-15-2009 , 08:40   Re: TF2 HELP - Making a player fully invisible
Reply With Quote #8

sm_alpha is a command by plugin FunCommandsX?
Chris-_- is offline
NeoDement
Member
Join Date: Mar 2009
Old 03-15-2009 , 11:07   Re: TF2 HELP - Making a player fully invisible
Reply With Quote #9

Exactly, remember I'm not just making my players invisible, it's part of a bigger script ;)
NeoDement is offline
HoboJim
New Member
Join Date: Mar 2008
Old 05-07-2009 , 23:03   Re: TF2 HELP - Making a player fully invisible
Reply With Quote #10

When using this, has anyone noticed that the weapon alpha in first person is only set if the player is using one of the unlockable weapons?

Does anyone have experience with setting the alpha for the firstperson weapon model for the standard weapons?
HoboJim 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 15:55.


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