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