Else statement get's called, even though if statement above is true
#3

PHP код:
#define MDC_LOOK_UP_CACHE_ESSENTIAL            (1) 
And when I do this, it's also working fine
PHP код:
else if(playertextid == MDC_g_sPlayer[playerid][E_MDC_TEXTDRAW][39]) 

    
printf("%i"MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_CACHE]); //Prints 1, so it equals to MDC_LOOK_UP_CACHE_ESSENTIAL 
    
if(MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_CACHE] == MDC_LOOK_UP_CACHE_ESSENTIAL
    { 
    } 
    else 
    { 
        
MDC_Update(playeridMDC_UPDATE_TECHNIQUE_WIPE_CONTENT_MDC_ITEM_LOOK_UPMDC_CONTENT_LICENSE); 
    } 
    return 
1

So does this:
PHP код:
else if(playertextid == MDC_g_sPlayer[playerid][E_MDC_TEXTDRAW][39]) 

    
printf("%i"MDC_LOOK_UP_CACHE_ESSENTIAL); //Prints 1 
    
if(MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_CACHE] == MDC_LOOK_UP_CACHE_ESSENTIAL
    { 
    } 
    else 
    { 
        
MDC_Update(playeridMDC_UPDATE_TECHNIQUE_WIPE_CONTENT_MDC_ITEM_LOOK_UPMDC_CONTENT_LICENSE); 
    } 
    return 
1

I have also tried to execute same code in main() and ZCMD command, it worked fine too.
So maybe it has something to do with OnPlayerClickPTD callback?

There must be some magic in my code
Reply


Messages In This Thread
Else statement get's called, even though if statement above is true - by Riwerry - 10.06.2017, 12:14
Re: Else statement get's called, even though if statement above is true - by SyS - 10.06.2017, 12:20
Re: Else statement get's called, even though if statement above is true - by Riwerry - 10.06.2017, 12:23

Forum Jump:


Users browsing this thread: 1 Guest(s)