Raised This Month: $47 Target: $400
 11% 

TF2 Crits Control?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheUnderTaker
Senior Member
Join Date: Dec 2013
Location: Israel
Old 08-30-2015 , 06:28   TF2 Crits Control?
Reply With Quote #1

I tried to write this code,

PHP Code:
public Action:TF2_CalcIsAttackCritical(clientweaponString:weaponname[], &bool:result)
{
    if(
Huntday && TF2_GetClientTeam(client) == TFTeam_Red)
    {
        
result true;
    }
    else if(!
Huntday)
    {
        
result false;

    }
    return 
Plugin_Continue;

This should work? If no why?
I'm not sure and didn't try but I maybe need to return Plugin_Changed;(after changing result value)?
btw : HuntDay was enabled and I was on team red.
__________________
SourcePawn, C# and C++ Programmer.

My plugin list

Last edited by TheUnderTaker; 08-30-2015 at 06:32.
TheUnderTaker is offline
Mehis
Senior Member
Join Date: Mar 2013
Location: basement
Old 08-30-2015 , 06:46   Re: TF2 Crits Control?
Reply With Quote #2

Quote:
Called on weapon fire to decide if the current shot should be critical. Return Plugin_Continue to let the original calculation or return a higher action to override the decision with the value of 'result'
https://sm.alliedmods.net/new-api/tf...AttackCritical
Mehis is offline
SoulSharD
Member
Join Date: Oct 2013
Location: United Kingdom
Old 08-30-2015 , 06:52   Re: TF2 Crits Control?
Reply With Quote #3

Quote:
Originally Posted by TheUnderTaker View Post
I'm not sure and didn't try but I maybe need to return Plugin_Changed;(after changing result value)?
That is EXACTLY what you need to do. I don't know why you didn't try that first.
__________________

SoulSharD is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 08-30-2015 , 07:41   Re: TF2 Crits Control?
Reply With Quote #4

Quote:
Originally Posted by TheUnderTaker View Post
I tried to write this code,

PHP Code:
public Action:TF2_CalcIsAttackCritical(clientweaponString:weaponname[], &bool:result)
{
    if(
Huntday && TF2_GetClientTeam(client) == TFTeam_Red)
    {
        
result true;
    }
    else if(!
Huntday)
    {
        
result false;

    }
    return 
Plugin_Continue;

This should work? If no why?
I'm not sure and didn't try but I maybe need to return Plugin_Changed;(after changing result value)?
btw : HuntDay was enabled and I was on team red.
Simpler code:
PHP Code:
public Action:TF2_CalcIsAttackCritical(clientweaponString:weaponname[], &bool:result)
{
    
result Huntday && TF2_GetClientTeam(client) == TFTeam_Red;
    return 
Plugin_Changed;

__________________

Last edited by WildCard65; 08-30-2015 at 07:41.
WildCard65 is offline
TheUnderTaker
Senior Member
Join Date: Dec 2013
Location: Israel
Old 08-30-2015 , 08:13   Re: TF2 Crits Control?
Reply With Quote #5

Quote:
Originally Posted by WildCard65 View Post
Simpler code:
PHP Code:
public Action:TF2_CalcIsAttackCritical(clientweaponString:weaponname[], &bool:result)
{
    
result Huntday && TF2_GetClientTeam(client) == TFTeam_Red;
    return 
Plugin_Changed;

Thank you!

Quote:
Originally Posted by SoulSharD View Post
That is EXACTLY what you need to do. I don't know why you didn't try that first.
Tried and still didn't work, solved.

BTW, Maybe someone know how to stop sounds?
I tried StopSound(i, SNDCHAN_AUTO, "mysound.mp3"); -------- In for loop.
__________________
SourcePawn, C# and C++ Programmer.

My plugin list

Last edited by TheUnderTaker; 08-30-2015 at 08:15.
TheUnderTaker is offline
Michalplyoutube
Veteran Member
Join Date: Jan 2013
Location: Tank Carrier in Mannhatt
Old 08-31-2015 , 11:26   Re: TF2 Crits Control?
Reply With Quote #6

U need to define sound u want to stop
__________________
The plugin developer of TF2BWR Reborn
And a TF2 Player
Michalplyoutube is offline
TheUnderTaker
Senior Member
Join Date: Dec 2013
Location: Israel
Old 08-31-2015 , 14:00   Re: TF2 Crits Control?
Reply With Quote #7

Quote:
Originally Posted by Michalplyoutube View Post
U need to define sound u want to stop
Look command above, It already defined, When i play it plays, but it doesn't stop.
__________________
SourcePawn, C# and C++ Programmer.

My plugin list
TheUnderTaker is offline
Reply


Thread Tools
Display Modes

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 20:34.


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