Monthly Target: $400 Donations: $438

Crit Issue

Post New Thread Reply   
Thread Tools Display Modes
Author Message
Join Date: Jul 2011
Location: United States
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;
Handle:chance INVALID_HANDLE;

crits CreateConVar("sm_crits_enabled""1");
chance CreateConVar("sm_crits_chance""1.00");

Action:TF2_CalcIsAttackCritical(clientweaponString:weaponname[], &bool:result)
    if (!
GetConVarFloat(chance) > GetRandomFloat(0.01.0) && CheckCommandAccess(client"sm_crits_flag"ADMFLAG_CUSTOM1))
result true;
result false;

ReFlexPoison is offline
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 03-26-2012 , 19:14   Re: Crit Issue
Reply With Quote #2

Try removing result = false; and changing the last line to return Plugin_Continue; instead.

As it currently stands, result = false; ensures that everyone without the ADMFLAG_CUSTOM1 do not get crits, then that change is set in stone by returning Plugin_Handled. Removing those two lines, and instead using return Plugin_Continue; would allow the normal calculations to continue, i.e. allowing other players to sometimes get crits.

Last edited by 11530; 03-27-2012 at 12:07.
11530 is offline
Join Date: Jul 2011
Location: United States
Old 03-26-2012 , 19:35   Re: Crit Issue
Reply With Quote #3

And that did it, thanks man.
ReFlexPoison is offline

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

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