Raised This Month: $ Target: $400
 0% 

Optimizng a Switch() statement


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 02-02-2009 , 18:03   Re: Optimizng a Switch() statement
Reply With Quote #3

You have some mistakes:
Code:
case 'h': nade = NADE_HE; case 'f': nade = NADE_FL; case 's': nade = NADE_SM;  ---> case 'h': nade = g_nade_ids[NADE_HE]; case 'f': nade = g_nade_ids[NADE_FL]; case 's': nade = g_nade_ids[NADE_SM]; // Also: if( !get_pcvar_num(g_pcvar_nade[nade]) ) return PLUGIN_HANDLED; // nade = grenades ids, and g_pcvar_nade is limited to 0, 1 and 2.
See why I got in trouble? ^^

+Karma when I can, still not solved.

EDIT: Never mind, I'll just use your method but instead of 'h', 'f' and 's' I'll use 0, 1 and 2.
Thanks.
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ

Last edited by Dores; 02-02-2009 at 18:12.
Dores 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 01:48.


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