Raised This Month: $ Target: $400
 0% 

optimising this "if"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-05-2009 , 12:56   Re: optimising this "if"
Reply With Quote #1

Code:
    switch ( g_ammopacks[id] )     {         case 0     .. 49    : level = 1;         case 50    .. 124   : level = 2;         case 125   .. 449   : level = 3;         case 450   .. 799   : level = 4;         case 800   .. 1249  : level = 5;         case 1250  .. 2499  : level = 6;         case 2500  .. 4999  : level = 7;         case 5000  .. 9999  : level = 8;         case 10000 .. 19999 : level = 9;         default             : level = 10;     }
Arkshine is offline
Speed!
BANNED
Join Date: Jan 2009
Old 02-05-2009 , 13:03   Re: optimising this "if"
Reply With Quote #2

Quote:
Originally Posted by arkshine View Post
Code:
    switch ( g_ammopacks[id] )     {         case 0     .. 49    : level = 1;         case 50    .. 124   : level = 2;         case 125   .. 449   : level = 3;         case 450   .. 799   : level = 4;         case 800   .. 1249  : level = 5;         case 1250  .. 2499  : level = 6;         case 2500  .. 4999  : level = 7;         case 5000  .. 9999  : level = 8;         case 10000 .. 19999 : level = 9;         default             : level = 10;     }
thanks it worked +k

Last edited by Speed!; 02-05-2009 at 13:13.
Speed! 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 01:51.


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