Raised This Month: $32 Target: $400
 8% 

[TF2] Crits Manager


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Dessix
Junior Member
Join Date: Oct 2009
Plugin ID:
1221
Plugin Version:
1.0.3
Plugin Category:
General Purpose
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    crits manager, allows overriding of standard crits calculation
    Unapprover:
    Reason for Unapproving:
    Race conditions exist. Author hasn't responded in months.
    Old 10-15-2009 , 00:58   [TF2] Crits Manager
    Reply With Quote #1

    Overview

    This plugins allows admins with the Slay flag to give anyone on the server one of 3 options: Always Crit, Never Crit and normal. This command takes precedence over the server wide crit management unless it is set to normal crits.

    This plugin can also override all crit calculations on the server in one of 3 following modes: Everyone Always Crits, Everyone Never Crits, and Custom Crit Rates. The server wide override must be enabled for it to take effect.

    The Custom Crit Rates are determined by 3 CVARs for primary weapons, secondary weapons and melee weapons. (listed below). the value of these cvars is the percent chance that a crit will happen with the given weapon slot. so if sm_critsmanager_crit_Primary is set to 5, there will be a flat 5% chance of a crit occurring with a primary weapon (this includes the sniper rifle).

    comes with full admin menu support, it adds an entry to player commands and server commands

    CVARs

    sm_critsmanager_version - contains the plguin version number
    sm_critsmanager_crit_Primary - <1 - 100> Default: 2 - chance of a crit with a Primaryweapon
    sm_critsmanager_crit_Secondary - <1 - 100> Default: 3 - chance of a crit with a secondary weapon
    sm_critsmanager_crit_Melee - <1 - 100> Default: 5 - chance of a crit with a melee weapon

    Zee Bugz

    - sniper rifle can crit on no scope (normally it can't as far as i know).
    - huntsman is not affected (only crits on headshot or mini crit with jarate).

    Todo

    - more advanced crit calculation (to take in account amount of damage done ect)


    This is one of a few plugins i'm going to post including an unlimited ammo plugin and a general utilities plugin. These are the first plugins i posted up here so please be gentle .

    also i commented pretty much every major step to help other programmers see what i did so they can copy/modify it. feel free to use whatever you find. hopefully i have a few good examples of things i wish i knew when i first started learning sourcepawn.
    Attached Files
    File Type: sp Get Plugin or Get Source (crits_manager.sp - 3747 views - 31.7 KB)

    Last edited by Dessix; 10-15-2009 at 01:11.
    Dessix is offline
    retsam
    Veteran Member
    Join Date: Aug 2008
    Location: so-cal
    Old 10-15-2009 , 01:09   Re: [TF2] Crits Manager
    Reply With Quote #2

    I think you mean this for the version cvar: sm_critsmanager_version

    Anyhow. Nice work. Im not sure where this would be needed as it would be severely overpowered to give one player all crits and other players normal or no crits, but anyways.

    Also, just fyi, huntsman does CRIT now if you either use 1.2.4 or above or use the extension....Ive been running my crits server with huntsman crits for a long time now.

    Last edited by retsam; 10-15-2009 at 01:11.
    retsam is offline
    noodleboy347
    AlliedModders Donor
    Join Date: Mar 2009
    Old 10-15-2009 , 01:12   Re: [TF2] Crits Manager
    Reply With Quote #3

    Wow, nice. Helpful for those constant melee crits...
    noodleboy347 is offline
    Dessix
    Junior Member
    Join Date: Oct 2009
    Old 10-15-2009 , 01:12   Re: [TF2] Crits Manager
    Reply With Quote #4

    Quote:
    Originally Posted by retsam View Post
    I think you mean this for the version cvar: sm_critsmanager_version

    Anyhow. Nice work. Im not sure where this would be needed as it would be severely overpowered to give one player all crits and other players normal or no crits, but anyways.
    lol thanks.

    damn those copy/paste errors >_>
    Dessix is offline
    noodleboy347
    AlliedModders Donor
    Join Date: Mar 2009
    Old 11-01-2009 , 12:01   Re: [TF2] Crits Manager
    Reply With Quote #5

    Quote:
    Originally Posted by drunkenfox1 View Post
    Hi there, i have the .sp on my server, but it isnt on the menu nor will work with console commands. help plz

    Yes i am newish to this type of thing
    You need the .smx
    noodleboy347 is offline
    drunkenfox1
    Member
    Join Date: Aug 2009
    Location: Orange
    Old 11-01-2009 , 12:04   Re: [TF2] Crits Manager
    Reply With Quote #6

    Ah
    drunkenfox1 is offline
    DarthNinja
    SourceMod Plugin Approver
    Join Date: Mar 2009
    Location: PreThinkHook()
    Old 11-01-2009 , 16:07   Re: [TF2] Crits Manager
    Reply With Quote #7

    Quote:
    Originally Posted by drunkenfox1 View Post
    Ah
    I posted this in your other thread too:

    .sp is the source code, you dont need it.
    .smx is the compiled code, it goes in /addons/sourcemod/plugins
    Dont forget to refresh your plugins.
    __________________
    DarthNinja is offline
    psychonic

    BAFFLED
    Join Date: May 2008
    Old 12-11-2009 , 09:50   Re: [TF2] Crits Manager
    Reply With Quote #8

    @Dessix

    Are you still working on this and plan to fix where you have:
    PHP Code:
    // *WARNING: potential race condition is multple admins are using this at once, may fix later" 
    (that can be easily solved with an array indexed by admin client id)
    psychonic is offline
    nemesis787
    Junior Member
    Join Date: Mar 2009
    Old 12-22-2009 , 11:00   Re: [TF2] Crits Manager
    Reply With Quote #9

    I am trying to set this to automatically load without having to enable it through the admin menu. What the enable/disable cvar? I'd Like to add this to my Sourcemod.cfg file to always enable my custom crit rates.

    Great Plugin By the way...very useful
    nemesis787 is offline
    Mnkras
    Senior Member
    Join Date: Mar 2009
    Location: 127.0.0.1
    Old 12-25-2009 , 12:43   Re: [TF2] Crits Manager
    Reply With Quote #10

    to have it enable automattically you have to find this line

    g_blnCritManagementEnabled = false;
    and change the false to true as he did not include a enable/disable cvar
    __________________
    Mnkras 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 20:20.


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