Raised This Month: $ Target: $400
 0% 

Hs ratio help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
avril-lavigne
Banned
Join Date: Apr 2009
Old 09-24-2012 , 13:09   Hs ratio help
Reply With Quote #1

PHP Code:
public client_damage(attackervictimdamagewpnindexhitplace)
{
    if ( 
attacker == victim || get_user_frags(attacker) < 10 ) return
    
    if ( 
hitplace == HIT_HEAD )
    {
        
gHeadShots[attacker]++
        
        
client_print(attackerprint_chat"[DEBUG] You now have %d headshots!"gHeadShots[attacker])
        
        
check_ratio(attacker)
        
    }

}


check_ratio(id) {     
      new 
Float:ratio 0.9 float(get_user_frags(id))
      
client_print(id,3,"Ratio hs/kill is %i"/*floatround */    ratio)
      if(
gHeadShots(id) > ratio
              
punish(id)

       
     }

in debug I always see ratio is 123654234 huge number

what I need - check Hs per kill . if over 90% ban
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc

Last edited by avril-lavigne; 09-24-2012 at 13:10.
avril-lavigne is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 09-24-2012 , 13:13   Re: Hs ratio help
Reply With Quote #2

You've never rushed with a TMP before, have you?
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
avril-lavigne
Banned
Join Date: Apr 2009
Old 09-24-2012 , 13:15   Re: Hs ratio help
Reply With Quote #3

I can make exception for knife / tmp / Uzi /. etc in curweapon
I dont care. I just need working code
and my request = another ratio
shots per kill . it really helps in HLstats. when I see users with 3-4 bullets per EVERY kill = its aimbot 100% . ( count bullets / get user frags if less than xxx bullets per frag = ban. and make exception for awp its not a problem )
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc

Last edited by avril-lavigne; 09-24-2012 at 13:19.
avril-lavigne is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 09-24-2012 , 13:22   Re: Hs ratio help
Reply With Quote #4

You'll need to count shots fired. CurWeapon is run every time someone fires a regular weapon (knifes are an exception)

Unless there's a pdata offset that contains shots fired....
__________________
What an elegant solution to a problem that doesn't need solving....

Last edited by Liverwiz; 09-24-2012 at 13:23.
Liverwiz is offline
avril-lavigne
Banned
Join Date: Apr 2009
Old 09-25-2012 , 05:39   Re: Hs ratio help
Reply With Quote #5

ok so what about code above? if I use floatround it makes 0.9 > to 1.0 so it doesnt work
If u dont use floatround it doesnt work at all. and shows me random big numbers
"Ratio hs/kill is %i" here
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc
avril-lavigne is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 09-25-2012 , 07:50   Re: Hs ratio help
Reply With Quote #6

PHP Code:
new Float0.123456;

server_print"%d"floatround) );
server_print"%i"floatround) );
server_print"%f");
server_print"%.2f"); // Output: 0.12
server_print"%f"float) ); 
%i is for integer values, not for floats!
floatround - transforms float to integer
__________________

Last edited by claudiuhks; 09-25-2012 at 07:50.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
Reply


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 08:10.


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