View Single Post
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-08-2019 , 13:53   Re: Avoid duplicating the code
Reply With Quote #7

PHP Code:
Function1()
{
    if( 
get_pcvar_numcvar1 )  && blablabla)
    {
            
    }
    else if( 
tuctuctuc ) {
            
    }

    
// 20 lines here

Simple.

Also you can use other ways depending on the variables scoop value and the cvar

If you fully duplicating the code means there is no different in body of the code of blabalabla and tuctuctuc why just do it in a one sentence

PHP Code:
  if( get_pcvar_numcvar1 ) && blablabla || tuctuctuc 
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 10-08-2019 at 14:00.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh