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

[TF2] Crits Manager V3.0


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Plugin ID:
3871
Plugin Version:
3.0
Plugin Category:
Gameplay
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    This plugin allow you to add or remove crits for all weapons !
    Old 09-01-2013 , 13:15   [TF2] Crits Manager V3.0
    Reply With Quote #1

    Crits Manager V3.0



    Plugin fixed !


    Description :


    With this plugin you would be enable to manage crits for all weapons ! Usefull for CRITS server and for fun as well !
    Original idea from LinKoClan : https://forums.alliedmods.net/showthread.php?t=225019

    Bugs :


    Any, for the moment...

    reporting a bug :
    This is NOT how to report a bug(s) :

    link

    This is how you report a bug :

    link

    Please, take care of this.


    Commands & Cvar :


    Command

    Any command

    Cvar

    sm_display_crits_messge "1"

    Display message to warn player about there crits stat. Put to 0 to disable.

    sm_ban_or_add_crits "0"

    THIS Cvar IS IMPORTANT !! you can choose to BAN weapons from crits or add them.

    1 = all weapons in CritsManager.cfg will be BANNED, that does mean crits for all weapons EXCEPT weapon who are in CritsManager.txt. NOTE: if this Cvar is set to 1, everyone will have crits.

    0 = all weapons in CritsManager.cfg will be ADDED, that does mean crits for any weapons EXCEPT weapon who are in CritsManager.txt.

    Installation :


    1) Put CritsManager.smx in your plugin folder : sourcemod/plugins
    2) Put CritsManager.cfg in your configs folder : sourcemod/configs
    3) Restart server, reload map or reload plugins folder.

    Require sdkhooks and morecolors to compile.

    Configuration :


    CritsManager.cfg can be configured like this :

    Put weapon index in config file. Each line, a weapon index.

    209, 1 and 18 are weapon index. You can found all weapon index here : Link

    Note: use CTRL+F to search a weapon by name.

    Request and think to do :


    Nothing, feel free to ask !!

    Screenshot :


    any for the moment

    Thanks to :


    bl4nk --> https://forums.alliedmods.net/showpo...06&postcount=2
    Attached Files
    File Type: smx CritsManager.smx (12.3 KB, 618 views)
    File Type: cfg CritsWeapon.cfg (10 Bytes, 737 views)
    File Type: sp Get Plugin or Get Source (CritsManager.sp - 448 views - 3.2 KB)
    __________________
    Want to check my plugins ?

    Last edited by Arkarr; 10-01-2015 at 03:16. Reason: Updated to 3.0
    Arkarr is offline
    LinKoClan
    Junior Member
    Join Date: Aug 2013
    Old 09-01-2013 , 20:15   Re: [TF2] Crits Manager V1.0
    Reply With Quote #2

    All of my weapons still don't have crits.
    My config is here https://www.dropbox.com/s/o9dzbxxoay...itsManager.txt
    My Cvar is set to sm_ban_or_add_crits "0"
    I also have SDHooks and morecolors if that helps.

    Last edited by LinKoClan; 09-01-2013 at 20:21.
    LinKoClan is offline
    Sreaper
    髪を用心
    Join Date: Nov 2009
    Old 09-01-2013 , 20:25   Re: [TF2] Crits Manager V1.0
    Reply With Quote #3

    Quote:
    Originally Posted by LinKoClan View Post
    All of my weapons still don't have crits.
    My config is here https://www.dropbox.com/s/o9dzbxxoay...itsManager.txt
    My Cvar is set to sm_ban_or_add_crits "0"
    I also have SDHooks and morecolors if that helps.
    I haven't looked at or tested this plugin myself, but have you also set the sm_number_of_weapons cvar?

    Last edited by Sreaper; 09-01-2013 at 20:26.
    Sreaper is offline
    LinKoClan
    Junior Member
    Join Date: Aug 2013
    Old 09-01-2013 , 20:56   Re: [TF2] Crits Manager V1.0
    Reply With Quote #4

    Yes, I have.
    LinKoClan is offline
    friagram
    Veteran Member
    Join Date: Sep 2012
    Location: Silicon Valley
    Old 09-02-2013 , 11:22   Re: [TF2] Crits Manager V1.0
    Reply With Quote #5

    Wait, every switch you do isvalidclient, open a file, check if you can give it crits, and then make the decision? Also dont look like you ever close the handle sooooo.

    Isvalidclient doesnt really do anything.......... Sourcetv and replay will never have weapons... And really... Just dont ever hook them anyways. This is a very bad stock in general, never should be used in loops.. Or client events..

    You can do all of your enabled cvar checks in your event hooks and sdkhook callbacks.

    As far as i can tell, the convar does nothing, you can just read the count from the file.. Or use an adt array and just search it for the defindex.

    Also, switchweapon is gonna return false positivesfor stuff like switching to bonk and empty items....
    This means that if i have a banned weapon, and switch to an unavailable unabnned weapon, ill get crits. And what about them clients with weapin switch macros that spam cycle weapons :/
    This is all kinds of bizzare.

    Use an array and cache only the banned stuff.
    Same with the file.. Just make it a blacklist. Or if you want to invert it that is fine, but you dont need all of those keyvalues...

    You can just do

    "Itemsblhablahblahmyplugin"
    {
    "1" "345"
    "2" "564"
    }

    Really it doesnt even matter if yu are going to next kv and reading the num for the kv, you dont even have to sequentially number them.. You could call them by name or apple, pear, rainbow.

    Imo just use a flatfile without kvs and a mess of numbers separated by whitespace, but w/e
    __________________
    Profile - Plugins
    Add me on steam if you are seeking sp/map/model commissions.

    Last edited by friagram; 09-02-2013 at 11:28.
    friagram is offline
    Arkarr
    Veteran Member
    Join Date: Sep 2012
    Location: Just behind my PC screen
    Old 09-02-2013 , 12:14   Re: [TF2] Crits Manager V1.0
    Reply With Quote #6

    Quote:
    Originally Posted by friagram View Post
    Isvalidclient doesnt really do anything.......... Sourcetv and replay will never have weapons... And really... Just dont ever hook them anyways. This is a very bad stock in general, never should be used in loops.. Or client events..
    Really ? So Chaosxk is wrong ?
    https://forums.alliedmods.net/showpo...7&postcount=25
    Quote:
    Originally Posted by friagram View Post
    you can just read the count from the file..
    How :S ? And thanks for precision.
    __________________
    Want to check my plugins ?
    Arkarr is offline
    ReFlexPoison
    ☠☠☠
    Join Date: Jul 2011
    Location: ☠☠☠
    Old 09-02-2013 , 12:36   Re: [TF2] Crits Manager V1.0
    Reply With Quote #7

    Quote:
    Originally Posted by Arkarr View Post
    The stock isn't going to effect anything. If you want to use it, use it, several do, including myself. Performance wont be affected and it's just another "security check." I believe I've seen Powerlord post something about checking these bools in some random thread awhile ago.
    ReFlexPoison is offline
    friagram
    Veteran Member
    Join Date: Sep 2012
    Location: Silicon Valley
    Old 09-02-2013 , 21:58   Re: [TF2] Crits Manager V1.2
    Reply With Quote #8

    Okay...
    If a client is hooked in most cases, they have an entity.
    If they have an entity (it's called "player") they are also in game.
    from this we can assume:

    their client index is >0 and <= maxplayers, and that they are connected, and that they are ingame.
    now.. if we do something when we hook clients, like (!IsFakeClient(client)) we can filter bots before we ever have to deal with them in the callbacks...

    You don't have to use the same callback for everything, I see this a lot, for example --- you could hook all fake clients for ontakedamagefakeclient and all players for ontakdamageplayers, and then in those functions, you already know what's what and don't have to do extra comparisons, you did it before you hooked them.
    Likewise, if you are going to check if something is enabled, you can do it at the start of your callback (just return, or put it in a huge if statement).. or if you really want to, you can remove your hooks, and never hook stuff at all if it's not enabled.

    So yeah.. That isvalidclientcrap is a ton of extra iterations, for stuff you KNOW you don't have to check (if you tihnk about it). Now, xeons can powerhouse through a lot of shitty coding, but they shouldn't have to. It's not a security check at all. You may as well just do this:

    If(IsClientIngame(client) && IsClientIngame(client) && IsClientIngame(client) && IsClientIngame(client) && IsClientIngame(client) && IsClientIngame(client) && IsClientIngame(client) && IsClientIngame(client) && IsClientIngame(client) && IsClientIngame(client) && IsClientIngame(client))

    are you any extra sure they are in game? no
    you just look stupid, and when you sit back and look at what it's actually doing, you'll realize that this is exactly what you are are doing. Or better yet:

    for(i = 1; i<=MaxClients;i++)
    {
    if(isvalidclient(i))
    }

    so now we already know they are in a range, but now we'll go ahead and check again if they are >0 and <= maxclients. Dumb.

    and back to Arkarr, you can just do like

    if(jumptokv)
    {
    new count;

    do{

    getkv
    count++;
    while(go to next kv)
    }
    __________________
    Profile - Plugins
    Add me on steam if you are seeking sp/map/model commissions.

    Last edited by friagram; 09-02-2013 at 22:00.
    friagram is offline
    Arkarr
    Veteran Member
    Join Date: Sep 2012
    Location: Just behind my PC screen
    Old 10-26-2013 , 07:05   Re: [TF2] Crits Manager V1.2
    Reply With Quote #9

    Plugin fixed !
    __________________
    Want to check my plugins ?
    Arkarr is offline
    DJ Data
    SourceMod Donor
    Join Date: Dec 2012
    Location: Switzerland
    Old 01-19-2015 , 13:45   Re: [TF2] Crits Manager V2.0
    Reply With Quote #10

    Can this be unnaproved?
    Its broken.
    __________________
    SourcePawn Coding Level: Novice
    DJ Data 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 02:58.


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