Raised This Month: $ Target: $400
 0% 

Optimize this..


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-07-2010 , 16:19   Re: Optimize this..
Reply With Quote #2

For the damage formula, manage yourself, it hurts my eyes..

For the switch statements :

Use a lookup table, you have to implement all weapons, put 1.0 for no change.
PHP Code:
new const Floatg_flDamageFactor[CSW_P90+1] =
{
    
0.0,
    
1.0// CSW_P228
    
0.0,
    
1.4// CSW_SCOUT
    
etc..
}

damage *= g_flDamageFactorget_user_weapon(attacker) ] 

For the level and cost :

PHP Code:
            switch( level 10 )
            {
                case 
0costo *= 1
                
case 1costo *= 4
                
case 2costo *= 6
                
case 3costo *= 8
                etc
... 
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
 



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 07:09.


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