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

Crit Issue


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
ReFlexPoison
☠☠☠
Join Date: Jul 2011
Location: ☠☠☠
Old 03-26-2012 , 19:08   Crit Issue
Reply With Quote #1

Pretty simple question here, don't know about response. Ever since I added this to my server, I didn't attempt to fix the problem, because, well, I didn't know there was one. I set it up to where anyone with ADMFLAG_CUSTOM1 receives %100 critical strikes. This works fine, however this disabled all crits for anyone else without this flag. (Even when uber charge or an all crits weapon is being used)

Easy fix question mark

PHP Code:
#include <sourcemod>
#include <tf2>

new Handle:crits INVALID_HANDLE;
new 
Handle:chance INVALID_HANDLE;

public 
OnPluginStart()
{
    
crits CreateConVar("sm_crits_enabled""1");
    
chance CreateConVar("sm_crits_chance""1.00");
    
    
CreateConVar("sm_crits_version"PLUGIN_VERSION"Crits Version"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
}


public 
Action:TF2_CalcIsAttackCritical(clientweaponString:weaponname[], &bool:result)
{
    if (!
GetConVarBool(crits))
    {
        return 
Plugin_Continue;    
    }
    
    if(
GetConVarFloat(chance) > GetRandomFloat(0.01.0) && CheckCommandAccess(client"sm_crits_flag"ADMFLAG_CUSTOM1))
    {
        
result true;
        return 
Plugin_Handled;    
    }
    
    
result false;
    
    return 
Plugin_Handled;

ReFlexPoison is offline
 



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 09:11.


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