hey guys, instead of disassembling my plugin to figure out how it works I can just tell you ;p
Bailopan has helped me a lot with misc things here or there and I am a long timer lurker here
So anyway, my plugin does a simple sig scan to find the places in the program that use the crit multipliers. I find the offset of the instruction such as
'fmul flt
0985849'
ever since the nov 7 update the crit chances have been moved from cvars to static data memory and this address just references the location. My plugin changes the address it references to a variable I control. So that any change to my variable is reflected in the calculate critical code. The cvars simply set my variable.
As far as your specific problem, I am not 100% but I am PRETTY sure players do not have their own crit chances. But I can offer you a possible solution. If I wanted to do this this is what I would do.
I would first do what I did and find the crit chance variables. Then I would replace those addresses with variables I control, just like in the real plugin. Here is where things get tricky. I would hook the CalcIsAttackCriticalHelper function (this is the function that, among other things, calculates if its a crit) for both melee and weapons and I do believe that DamageInfo variable it passes holds the attacker's pointer... But I would use that, cross reference it with my own player pointers to find out what crit chance the player should have, and set my crit variable to that value. Then return to the CritcalHelper function and let it execute with the 'correct' crit chance.
Every time a player fire's your plugin's hook will get called and the crit chance variable will change to whatever that player should have at that point in time.
It sounds like a cool idea, but of course I dont ever plan to actually implement something like this ;p But theoretically I think that might be the best, if not the only solution for you.
That being said I do not know the extent of this scripting language so that might not even be possible in this scenario, but if I was writing a real source plugin thats what I would do.