Raised This Month: $ Target: $400
 0% 

Is it possible to optimize this code?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 01-04-2009 , 13:15   Re: Is it possible to optimize this code?
Reply With Quote #3

PHP Code:
register_clcmd("say","rules")
 
public 
rules(id)
{
     new 
arg[33]
     
read_argv(1,arg,32)
 
     if(
equali(arg,"/noriuvip"))
     {
          
show_motd(id,"noriuvip.txt","Nori VIP?")
     }
     else if(
equali(arg,"/viprules"))
     {
          
show_motd(id,"viprules.txt","VIP taisykles")
     }
     else if(
equali(arg,"/rules"))
     {
          
show_motd(id,"rules.txt","Taisykles")
     }
     else
     {
           return 
PLUGIN_CONTINUE
     
}
 
     return 
PLUGIN_HANDLED

Not sure how/what you're doing with flags on the clcmd, because I've never used them, but here's what I would do if you had to have it in a single function to satisfy yourself.

If the flags meant anything important, you'll have to add another check to the if statements.
__________________
Bad_Bud 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 23:11.


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