Raised This Month: $ Target: $400
 0% 

Detect related


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 12-19-2005 , 21:22  
Reply With Quote #6

Rewritten ever so slightly to follow the rule that you should place the most likely condition at the top of a list of conditionals. Also took of the second condition as a boolean only has two values so you don't need to check it twice. Also added semicolons because that's what I do. Also added a space after each if because damn it, that's how God intended it to be (He also intended programmers to use tabs instead of spaces but I didn't fix that).

Code:
 new bool:g_MyFunctionUsed[33]; // Global Value. public MyFunction(id) {     if (g_MyFunctionUsed[id])     {         console_print(id, "You have already activated this command.");     }         else     {         g_MyFunctionUsed[id] = true;     } }
Brad 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 16:10.


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