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)

Quimbo 07-29-2009 18:58

Re: [TF2] Addcond
 
Indeed, I'd be interested in seeing the extension as well, especially as an example how to do it.

Would be nice!

BrutalGoerge 08-02-2009 01:15

Re: [TF2] Addcond
 
seems uber cond won't work on the losing team

*cry

Chris-_- 08-02-2009 09:40

Re: [TF2] Addcond
 
All of em are conditional *shock*, like if you get healed by a medic, you loose uber aswell because they're ubermeter *usually* is lower then 100%.

Wazz 08-02-2009 18:10

Re: [TF2] Addcond
 
Just what I was looking for, many thanks MikeJS.

Theme97 08-02-2009 19:06

Re: [TF2] Addcond
 
Better cheats handling:
PHP Code:

stock TF2_AddCond(clientcond) {
    new 
flags GetCommandFlags("addcond");
    
SetCommandFlags("addcond"flags & ~FCVAR_CHEAT);
    
FakeClientCommand(client"addcond %d"cond);
    
SetCommandFlags("addcond"flags);


Written in quick-reply box but I use this method in Randomizer and it works just fine.

genkernel 08-04-2009 09:03

Re: [TF2] Addcond
 
Quote:

Originally Posted by Theme97 (Post 888766)
Better cheats handling:
PHP Code:

stock TF2_AddCond(clientcond) {
    new 
flags GetCommandFlags("addcond");
    
SetCommandFlags("addcond"flags & ~FCVAR_CHEAT);
    
FakeClientCommand(client"addcond %d"cond);
    
SetCommandFlags("addcond"flags);


Written in quick-reply box but I use this method in Randomizer and it works just fine.

Doesn't work for me, Still needed to enable cheats before it would work.

Theme97 08-04-2009 13:40

Re: [TF2] Addcond
 
Quote:

Originally Posted by genkernel (Post 889965)
Doesn't work for me, Still needed to enable cheats before it would work.

Hah, just realized I tested on my listen server where sv_cheats is always on.

Gonna try various methods to see what does work.

EHG 08-22-2009 09:42

Re: [TF2] Addcond
 
You will not be able to run this command with server side sv_cheats turned off since this is one of those commands that requires sv_cheats to be enabled serverside to work.
You can use this:
http://forums.alliedmods.net/showthread.php?t=92289
to send sv_cheats 1 to a client and see for yourself.

However there is a chance removing addcond's cheat flag would remove its dependency on server side sv_cheats. However this is unlikely since other commands like thirdperson do not lose their dependency.

This is a better way to handle the sv_cheats,
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|FCVAR_REPLICATED));
        
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|FCVAR_REPLICATED));
        
SetConVarBool(cvartrue);
    }
    
FakeClientCommand(client"removecond %i"cond);
    if(!
enabled) {
        
SetConVarBool(cvarfalse);
        
SetConVarFlags(cvarflags);
    }


This way the replicated flag is also removed so sv_cheats 1 is never sent to the client and only changed serverside.

WiKer 08-30-2009 10:29

Re: [TF2] Addcond
 
can someone make this like plugin?

pheadxdll 08-30-2009 12:35

Re: [TF2] Addcond
 
EHG: That didn't work the last time I tried it.


All times are GMT -4. The time now is 18:44.

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