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

Weapon Max Shot Distance


Post New Thread Reply   
 
Thread Tools Display Modes
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 10-21-2011 , 17:11   Re: Weapon Max Shot Distance
Reply With Quote #21

Quote:
Originally Posted by ConnorMcLeod View Post
RegisterCVars function doesn't need to be public
g_szWeaponClassnames shouldn't be global, declare it in RegisterCVars function so memory is free when you exit the function.



i < MAX_WEAPON + 1
i <= MAX_WEAPON would make more sense



Little tip :
PHP Code:
            formatexszCVarNamecharsmaxszCVarName ), "max_distance_%s"g_szWeaponClassnames] );
            
            
replaceszCVarNamecharsmaxszCVarName ), "weapon_""" ); 
->
PHP Code:
            formatexszCVarNamecharsmaxszCVarName ), "max_distance_%s"g_szWeaponClassnames][ ] ); 


PHP Code:
        static Float:flAttackerOrigin];
        static 
Float:flVictimOrigin]; 
Static is not needed at all there.



Code:
        if( !g_pWeaponCVARs[ iWeapon ] )
            return HAM_IGNORED;        
        new iMaxDistance = get_pcvar_num( g_pWeaponCVARs[ iWeapon ] );
You read 2 times the same array, would be better to cache pointer result.



DMG_HEGRENADE check is useless, it will never happen.
Fixed.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
xakintosh
I run no-steam servers!
Join Date: Feb 2010
Location: Edge of nowhere
Old 10-24-2011 , 11:03   Re: Weapon Max Shot Distance
Reply With Quote #22

Awesome
__________________
As soon as possible.
xakintosh is offline
Send a message via Yahoo to xakintosh Send a message via Skype™ to xakintosh
Sandervraun
Senior Member
Join Date: May 2019
Location: Denmark
Old 05-12-2020 , 19:10   Re: Weapon Max Shot Distance
Reply With Quote #23

Is this working for CSGO?
Sandervraun is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 05-12-2020 , 19:15   Re: Weapon Max Shot Distance
Reply With Quote #24

Quote:
Originally Posted by Sandervraun View Post
Is this working for CSGO?
No.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Weasel
AlliedModders Donor
Join Date: Apr 2004
Location: Undisclosed / Secure
Old 03-17-2024 , 20:50   Re: Weapon Max Shot Distance
Reply With Quote #25

Anyone have a good baseline for the distances to use for each weapon?
__________________
Pwease pardon by bad Engrish.
Steam Profile, Steam Group, Stats, Twitter

Last edited by Weasel; 03-17-2024 at 20:50.
Weasel is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 03-28-2024 , 12:13   Re: Weapon Max Shot Distance
Reply With Quote #26

Quote:
Originally Posted by Weasel View Post
Anyone have a good baseline for the distances to use for each weapon?
Probably depends on several aspects:
  • Server type
  • Map size
  • Player amount

Error and trial is the way to go i suppose.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
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 11:43.


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