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

[TF2] Addcond


Post New Thread Reply   
 
Thread Tools Display Modes
Quimbo
Member
Join Date: May 2008
Old 07-29-2009 , 18:58   Re: [TF2] Addcond
Reply With Quote #21

Indeed, I'd be interested in seeing the extension as well, especially as an example how to do it.

Would be nice!
Quimbo is offline
BrutalGoerge
AlliedModders Donor
Join Date: Jul 2007
Old 08-02-2009 , 01:15   Re: [TF2] Addcond
Reply With Quote #22

seems uber cond won't work on the losing team

*cry
__________________
My Pluggies If you like, consider to me.
BrutalGoerge is offline
Chris-_-
SourceMod Donor
Join Date: Oct 2008
Old 08-02-2009 , 09:40   Re: [TF2] Addcond
Reply With Quote #23

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%.
Chris-_- is offline
Wazz
SourceMod Donor
Join Date: Mar 2009
Old 08-02-2009 , 18:10   Re: [TF2] Addcond
Reply With Quote #24

Just what I was looking for, many thanks MikeJS.
Wazz is offline
Theme97
Senior Member
Join Date: Mar 2009
Old 08-02-2009 , 19:06   Re: [TF2] Addcond
Reply With Quote #25

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.
__________________
I now have very little time to work on stuff and my main computer (which is the only one that can run TF2) is not cooperating with me, so don't expect many updates from me anytime soon.

[ALL] Karaoke
[TF2] Intel Timer | Crabmod | Randomizer | Stopwatch | Crits 4 All

Last edited by Theme97; 08-02-2009 at 19:09.
Theme97 is offline
genkernel
Junior Member
Join Date: Nov 2004
Old 08-04-2009 , 09:03   Re: [TF2] Addcond
Reply With Quote #26

Quote:
Originally Posted by Theme97 View Post
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.
genkernel is offline
Theme97
Senior Member
Join Date: Mar 2009
Old 08-04-2009 , 13:40   Re: [TF2] Addcond
Reply With Quote #27

Quote:
Originally Posted by genkernel View Post
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.
__________________
I now have very little time to work on stuff and my main computer (which is the only one that can run TF2) is not cooperating with me, so don't expect many updates from me anytime soon.

[ALL] Karaoke
[TF2] Intel Timer | Crabmod | Randomizer | Stopwatch | Crits 4 All
Theme97 is offline
EHG
Senior Member
Join Date: May 2009
Location: 127.0.0.1
Old 08-22-2009 , 09:42   Re: [TF2] Addcond
Reply With Quote #28

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.

Last edited by EHG; 09-30-2009 at 10:56. Reason: Fixed script
EHG is offline
WiKer
Member
Join Date: Apr 2009
Old 08-30-2009 , 10:29   Re: [TF2] Addcond
Reply With Quote #29

can someone make this like plugin?
WiKer is offline
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 08-30-2009 , 12:35   Re: [TF2] Addcond
Reply With Quote #30

EHG: That didn't work the last time I tried it.
pheadxdll 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 12:58.


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