AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [TF2] Addcond (https://forums.alliedmods.net/showthread.php?t=98542)

MikeJS 07-26-2009 12:47

[TF2] Addcond
 
PHP Code:

stock TF2_AddCond(clientcond) {
    new 
Handle:cvar FindConVar("sv_cheats"), bool:enabled GetConVarBool(cvar), flags GetConVarFlags(cvar);
    if(!
enabled) {
        
SetConVarFlags(cvarflags^FCVAR_NOTIFY);
        
SetConVarBool(cvartrue);
    }
    
FakeClientCommand(client"addcond %i"cond);
    if(!
enabled) {
        
SetConVarBool(cvarfalse);
        
SetConVarFlags(cvarflags);
    }
}
stock TF2_RemoveCond(clientcond) {
    new 
Handle:cvar FindConVar("sv_cheats"), bool:enabled GetConVarBool(cvar), flags GetConVarFlags(cvar);
    if(!
enabled) {
        
SetConVarFlags(cvarflags^FCVAR_NOTIFY);
        
SetConVarBool(cvartrue);
    }
    
FakeClientCommand(client"removecond %i"cond);
    if(!
enabled) {
        
SetConVarBool(cvarfalse);
        
SetConVarFlags(cvarflags);
    }


TF2_AddCond(client, 5) will ubercharge a player and TF2_AddCond(client, 11) will kritzkrieg them (works with tf_weapon_criticals 0).

Chris-_- 07-26-2009 13:13

Re: [TF2] Addcond
 
Brilliant stocks :D

J-Factor 07-26-2009 13:37

Re: [TF2] Addcond
 
Wow.

This is amazing. How did you find the commands?

The possibilities are endless... just after a quick test I've found you can make any class disguise (if you also set the appropriate props).

Great work.

EDIT:

From my quick testing:

0 = Civilian
1 = Sniper Scope (doesn't zoom in)
2 = Start of Disguise sequence
3 = Disguise (set m_nDisguiseTeam, etc. after applying to select the team/class/player/weapon)
4 = Cloak (only seems to work with Spy)
5 = Uber
6 = Glow from recently using a teleporter
7 = Useless (this is used for when you taunt)
8 = Unknown
9 = Unknown (probably useless since it doesn't alter your condition)
10 = Unknown
11 = Kritz (seems to disable when you kill someone)
12 = Unknown
13 = Unknown (probably useless since it doesn't alter your condition)
14 = Bonk'd (only lasts 5 seconds for Scout; interesting note: if you taunt you stay in third person even with sv_cheats 0)
15 = Useless (this is used for when you are slowed after drinking Bonk and when you're stunned)
16 = Unknown
17 = Useless (this is used for when you are ignited, makes you say fire voice response)
18 = Unknown
19 = Jarate

Example code to disguise as your class on the enemy team (after adding condition 3):

Code:

SetEntProp(client, Prop_Send, "m_nDisguiseClass", TF2_GetPlayerClass(client));
SetEntProp(client, Prop_Send, "m_nDisguiseTeam", GetClientTeam(client) == 2 ? 3 : 2);


Chris-_- 07-26-2009 13:42

Re: [TF2] Addcond
 
Please share everything you have on this.

Chris-_- 07-26-2009 13:50

Re: [TF2] Addcond
 
/del

Sexual Harassment Panda 07-26-2009 15:48

Re: [TF2] Addcond
 
I'm kind of confused as to how to use this, but that's probably just me.

MikeJS 07-26-2009 16:06

Re: [TF2] Addcond
 
Quote:

Originally Posted by J-Factor (Post 882300)
This is amazing. How did you find the commands?

Some guy named Aron added be on steam and PM'ed me them

bl4nk 07-26-2009 16:17

Re: [TF2] Addcond
 
Code:

#define PLAYERCOND_SLOWED (1<<0) //1
#define PLAYERCOND_ZOOMED (1<<1) //2
#define PLAYERCOND_DISGUISING (1<<2) //4
#define PLAYERCOND_DISGUISED (1<<3) //8
#define PLAYERCOND_SPYCLOAK (1<<4) //16
#define PLAYERCOND_UBERED (1<<5) //32
#define PLAYERCOND_TELEPORTTRAIL (1<<6) //64
#define PLAYERCOND_TAUNT (1<<7) //128
// (1<<8) //256
// (1<<9) //512
#define PLAYERCOND_TELEPORTFLASH (1<<10) //1024
#define PLAYERCOND_KRUBER (1<<11) //2048
// (1<<12) //4096
// (1<<13) //8192
#define PLAYERCOND_BONKED (1<<14) //16384 (blame Neph if it doesn't work)
#define PLAYERCOND_BONKEDORDRINKSLOWDOWN (1<<15) //32768
#define PLAYERCOND_HEALING (1<<16) //65536
#define PLAYERCOND_BURNING (1<<17) //131072
#define PLAYERCOND_FULLYCHARGEDBYMEDIC (1<<18) //262144


Chris-_- 07-26-2009 17:25

Re: [TF2] Addcond
 
Thank you, was looking for that one

Gachl 07-27-2009 02:02

Re: [TF2] Addcond
 
My hero! +K for you!


All times are GMT -4. The time now is 15:48.

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