Raised This Month: $ Target: $400
 0% 

Wich method is better?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
zeus
Senior Member
Join Date: Jul 2008
Old 04-12-2011 , 11:42   Re: Wich method is better?
Reply With Quote #4

For example i have this code
Code:
public check(id)
{
    if(is_user_retarded(id))
          cmd_retard(id)
    else if(is_user_idiot(id))
          cmd_idiot(id)
}

public cmd_retard(id)
    client_print(id,print_chat,"You are retarded !!!")

public cmd_idiot(id)
    client_print(id,print_chat,"You are an idiot !!!")
Is it better if I do something like this?
Code:
public check(id)
{
    if(is_user_retarded(id))
          cmd_retard_or_idiot(id,1)
    else if(is_user_idiot(id))
          cmd_retard_or_idiot(id,2)
}

public cmd_retard_or_idiot(id,x)
{
    if(x==1)
        client_print(id,print_chat,"You are retarded !!!")
    else if(x==2)
        client_print(id,print_chat,"You are an idiot !!!")
}
zeus 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 20:10.


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