Raised This Month: $ Target: $400
 0% 

Is there a faster way to do this?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
dwelty
New Member
Join Date: Feb 2005
Old 03-23-2005 , 11:17  
Reply With Quote #7

Quote:
Originally Posted by v3x
Code:
// ..     switch(level[id]) {         case 1: set_user_maxspeed(id,320.0)         case 2: set_user_maxspeed(id,321.0)         case 3: set_user_maxspeed(id,321.0)         // etc..     }
Should work :).

I see a lot of this. Common mistake. You forgot your breaks. Case execution falls through. it should look like this:

Code:
// ..   switch(level[id])   {     case 1:     {       set_user_maxspeed(id,320.0);       break;     }     case 2:     {       set_user_maxspeed(id,321.0);       break;     }     case 3:     {       set_user_maxspeed(id,322.0);       break;     }     // etc..   }


XxAvalanchexX had the right idea though. That's your best bet.
__________________
dwelty 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 09:55.


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