Raised This Month: $51 Target: $400
 12% 

[L4D2]Weapn spread & accuracy question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gilmon
Senior Member
Join Date: Feb 2011
Location: China
Old 01-25-2014 , 20:35   [L4D2]Weapn spread & accuracy question
Reply With Quote #1

Hello there,i'm very in trouble about the shotgun spread and accuracy.

Yeah I know the accuracy count should be "hit the target"/"Total shoot time * 100%"
PHP Code:
playerGunfiredTime[Client] ? float(playerHitenemy[Client]) / float(playerGunfiredTime[Client]) * 100.0 0.0 
but there's a big problem about the shotgun: every shotgun spread warhead will count as a "playerHitenemy",so I always see the player's accuracy become more than 100% like 500%,700%,375%, .. (etc

Any fix to this? Or should I check it's shotgun or not? but the every shotgun spread is different,I have to write many function to count every type.
gilmon is offline
Send a message via MSN to gilmon
gilmon
Senior Member
Join Date: Feb 2011
Location: China
Old 01-26-2014 , 23:32   Re: [L4D2]Weapn spread & accuracy question
Reply With Quote #2

sorry for bump, but still need help
gilmon is offline
Send a message via MSN to gilmon
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 01-27-2014 , 08:02   Re: [L4D2]Weapn spread & accuracy question
Reply With Quote #3

Use TR_TraceRayFilter().
Detect if player press the attack button and use TR_TraceRayFilter() to check if the crosshair is pointed to the right target.
__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.

Last edited by GsiX; 01-27-2014 at 08:03.
GsiX is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 01-27-2014 , 11:16   Re: [L4D2]Weapn spread & accuracy question
Reply With Quote #4

Depends on how you define accuracy. You can either do what GsiX said or count the hit-percentage of each "shrapnel" (Is "shrapnel" the correct word?).
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.
Dr. Greg House 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 19:59.


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