AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   TF2: Make razorback invisible? (https://forums.alliedmods.net/showthread.php?t=93455)

retsam 05-29-2009 05:47

TF2: Make razorback invisible?
 
Having a little issue. It looks like one of the rtd rolls got broken in a manner of speaking in last tf2 update.

Does anyone know how to fix this so it also includes the razorback and possibly jarette(which I dont have yet to test)?

This is the invis code by spazman0 that makes players invis. The razorback does NOT get the invis applied to it. The entire player and other weapons are invis, but not the shield. I tried fiddling with the code, but I couldnt get it to work. It looks like it reads it as entity -1. In regards to this, ive had some sm errors related to "[SM] Native "GetEntDataEnt2" reported: Entity 11 is invalid, 9 invalid, 32 invalid, etc". The line it points to is "weapon = GetEntDataEnt2(client, m_hMyWeapons + i);"

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);
                }
            }
        }
}

DoColorize(client)
{
        SetWeaponsColor(client);
    SetEntityRenderMode(client, RENDER_NORMAL);
    SetEntityRenderColor(client, 255, 255, 255, 255);
   
    SetAlpha(client, 255);
}


SetWeaponsColor(client)
{
    new m_hMyWeapons = FindSendPropOffs("CBasePlayer", "m_hMyWeapons");   

    for(new i = 0, weapon; i < 47; i += 4)
    {
        weapon = GetEntDataEnt2(client, m_hMyWeapons + i);
   
        if(weapon > -1 )
        {
            SetEntityRenderMode(weapon, RENDER_NORMAL);
            SetEntityRenderColor(weapon, 255, 255, 255, 255);
        }
    }
}


CrimsonGT 05-29-2009 07:01

Re: TF2: Make razorback invisible?
 
Have you tried GetPlayerWeaponSlot() to get the index?

Muridias 05-31-2009 05:08

Re: TF2: Make razorback invisible?
 
I believe spy's watches and sniper razorback doesn't appear in the slots. I don't know how to check for them either.

Spazman0 06-01-2009 01:28

Re: TF2: Make razorback invisible?
 
I believe this is caused as Razorback doesn't actually have it's own slot, and therefore isn't included. You'd have to find a way to add a seperate check for Razorback and make it invisible.

retsam 06-01-2009 01:34

Re: TF2: Make razorback invisible?
 
I know thats the problem. Since razorback is more of a player item, or whatever you wanna call it(i dont have a clue how the game reads it) and no longer a player slot, I dont know how youd do that.

If you think of anything, let me know. Cause snipers with razorbacks cannot be invisible now, or I should say, they are invisible with the shield floating around. heh.

NeoDement 06-02-2009 15:03

Re: TF2: Make razorback invisible?
 
I bet hats do the same problem

MikeJS 06-02-2009 16:28

Re: TF2: Make razorback invisible?
 
report_entities shows it's a tf_wearable_item.

soulnothing 06-10-2009 04:03

Re: TF2: Make razorback invisible?
 
Edited cause i wasnt thinking properly. Ive removed model references in the past from items.txt, but i forgot its borked now, sorry.

retsam 06-10-2009 04:54

Re: TF2: Make razorback invisible?
 
Not exactly sure what youre suggesting, but that is most definitely not how you make the razorback invisible. :P

I already got the help and code to do it anyways, so I no longer need help. Thx though.


All times are GMT -4. The time now is 00:56.

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