View Single Post
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