SA-MP Forums Archive
warning 225: unreachable code - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: warning 225: unreachable code (/showthread.php?tid=632729)



warning 225: unreachable code - Man43 - 18.04.2017

Hello there a small problem but idk how to fix it :/

ERROR:-

Код:
warning 225: unreachable code
PHP код:
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
    if ( !
strcmp( cmdtext, "/bank" ) )
    if (
IsPlayerInRangeOfPoint(playerid, 7.0, 2316.6213,-7.3885,26.7422)) return SendClientMessage(playerid, -1, "You must be in bank.");
    {
        
INI_ParseFile( ReturnBankingName( playerid ), "ParseReceived", .bExtra = true, .extra = playerid );
        if ( 
fexist( ReturnBankingName( playerid ) ) && !P_DATA[ playerid ][ P_Logged ] )
            
ShowPlayerDialog( playerid, BANK_LOGIN, DIALOG_STYLE_INPUT, ""COL_ALL"Banking System: {FFFFFF}Login", ""COL_GREY"Please insert the password of your Bank Account", "Login", "Exit");
        else if ( !
fexist( ReturnBankingName( playerid ) ) )
            
ShowPlayerDialog( playerid, BANK_CREATE, DIALOG_STYLE_MSGBOX, ""COL_ALL"Banking System", "{FFFFFF}You don't have a "COL_ALL"Banking Account{FFFFFF}\nWould you like to create?", "Yes", "Exit");
        else if ( 
P_DATA[ playerid ][ P_Logged ] && !GetPVarInt( playerid, "MoneyReceived" ) )
            
ShowPlayerDialog( playerid, BANK, DIALOG_STYLE_LIST, ""COL_ALL"Banking System", "{FFF1EB}Deposit\n\
                                                                  {FFF1EB}Withdraw\n\
                                                                  {FFF1EB}Transfer\n\
                                                                  {FFF1EB}Account Information\n\
                                                                  {FFF1EB}Banking System Information\n\
                                                                  {FFF1EB}Cancel account\n\
                                                                  {D9997E}Exit"
, "Select", "");
        else if ( 
P_DATA[ playerid ][ P_Logged ] == 1 && GetPVarInt( playerid, "MoneyReceived" ) == 1 )
            
ShowPlayerDialog( playerid, BANK, DIALOG_STYLE_LIST, ""COL_ALL"Banking System", "{FFF1EB}Deposit\n\
                                                                  {FFF1EB}Withdraw\n\
                                                                  {FFF1EB}Transfer\n\
                                                                  {FFF1EB}Account Information\n\
                                                                  {FFF1EB}Banking System Information\n\
                                                                  {FFF1EB}Cancel account\n\
                                                                  {9CFFC2}Receive Transfer\n\
                                                                  {D9997E}Exit"
, "Select", "");
        return 
1;
    }
    return 
0;
} 



Re: warning 225: unreachable code - khRamin78 - 18.04.2017

your problem is here
PHP код:
if ( !strcmp( cmdtext, "/bank" ) ) 
please use "{}" for if statements you dident used even once


Re: warning 225: unreachable code - Man43 - 18.04.2017

Quote:
Originally Posted by khRamin78
Посмотреть сообщение
your problem is here
PHP код:
if ( !strcmp( cmdtext, "/bank" ) ) 
please use "{}" for if statements you dident used even once
?? Can you edit my code then past it ?


Re: warning 225: unreachable code - Spoookymon - 18.04.2017

PHP код:
public OnPlayerCommandText( playerid, cmdtext[ ] ) 
{ 
    if ( !
strcmp( cmdtext, "/bank" ) )
{
    if (
IsPlayerInRangeOfPoint(playerid, 7.0, 2316.6213,-7.3885,26.7422)) return SendClientMessage(playerid, -1, "You must be in bank."); 
    { 
        
INI_ParseFile( ReturnBankingName( playerid ), "ParseReceived", .bExtra = true, .extra = playerid ); 
        if ( 
fexist( ReturnBankingName( playerid ) ) && !P_DATA[ playerid ][ P_Logged ] ) 
            
ShowPlayerDialog( playerid, BANK_LOGIN, DIALOG_STYLE_INPUT, ""COL_ALL"Banking System: {FFFFFF}Login", ""COL_GREY"Please insert the password of your Bank Account", "Login", "Exit"); 
        else if ( !
fexist( ReturnBankingName( playerid ) ) ) 
            
ShowPlayerDialog( playerid, BANK_CREATE, DIALOG_STYLE_MSGBOX, ""COL_ALL"Banking System", "{FFFFFF}You don't have a "COL_ALL"Banking Account{FFFFFF}\nWould you like to create?", "Yes", "Exit"); 
        else if ( 
P_DATA[ playerid ][ P_Logged ] && !GetPVarInt( playerid, "MoneyReceived" ) ) 
            
ShowPlayerDialog( playerid, BANK, DIALOG_STYLE_LIST, ""COL_ALL"Banking System", "{FFF1EB}Deposit\n\ 
                                                                  {FFF1EB}Withdraw\n\ 
                                                                  {FFF1EB}Transfer\n\ 
                                                                  {FFF1EB}Account Information\n\ 
                                                                  {FFF1EB}Banking System Information\n\ 
                                                                  {FFF1EB}Cancel account\n\ 
                                                                  {D9997E}Exit"
, "Select", ""); 
        else if ( 
P_DATA[ playerid ][ P_Logged ] == 1 && GetPVarInt( playerid, "MoneyReceived" ) == 1 ) 
            
ShowPlayerDialog( playerid, BANK, DIALOG_STYLE_LIST, ""COL_ALL"Banking System", "{FFF1EB}Deposit\n\ 
                                                                  {FFF1EB}Withdraw\n\ 
                                                                  {FFF1EB}Transfer\n\ 
                                                                  {FFF1EB}Account Information\n\ 
                                                                  {FFF1EB}Banking System Information\n\ 
                                                                  {FFF1EB}Cancel account\n\ 
                                                                  {9CFFC2}Receive Transfer\n\ 
                                                                  {D9997E}Exit"
, "Select", ""); 
        return 
1; 
    }
return 
1;
}
    return 
0; 
} 



Re: warning 225: unreachable code - Man43 - 18.04.2017

Quote:
Originally Posted by Spoookymon
Посмотреть сообщение
PHP код:
public OnPlayerCommandText( playerid, cmdtext[ ] ) 
{ 
    if ( !
strcmp( cmdtext, "/bank" ) )
{
    if (
IsPlayerInRangeOfPoint(playerid, 7.0, 2316.6213,-7.3885,26.7422)) return SendClientMessage(playerid, -1, "You must be in bank."); 
    { 
        
INI_ParseFile( ReturnBankingName( playerid ), "ParseReceived", .bExtra = true, .extra = playerid ); 
        if ( 
fexist( ReturnBankingName( playerid ) ) && !P_DATA[ playerid ][ P_Logged ] ) 
            
ShowPlayerDialog( playerid, BANK_LOGIN, DIALOG_STYLE_INPUT, ""COL_ALL"Banking System: {FFFFFF}Login", ""COL_GREY"Please insert the password of your Bank Account", "Login", "Exit"); 
        else if ( !
fexist( ReturnBankingName( playerid ) ) ) 
            
ShowPlayerDialog( playerid, BANK_CREATE, DIALOG_STYLE_MSGBOX, ""COL_ALL"Banking System", "{FFFFFF}You don't have a "COL_ALL"Banking Account{FFFFFF}\nWould you like to create?", "Yes", "Exit"); 
        else if ( 
P_DATA[ playerid ][ P_Logged ] && !GetPVarInt( playerid, "MoneyReceived" ) ) 
            
ShowPlayerDialog( playerid, BANK, DIALOG_STYLE_LIST, ""COL_ALL"Banking System", "{FFF1EB}Deposit\n\ 
                                                                  {FFF1EB}Withdraw\n\ 
                                                                  {FFF1EB}Transfer\n\ 
                                                                  {FFF1EB}Account Information\n\ 
                                                                  {FFF1EB}Banking System Information\n\ 
                                                                  {FFF1EB}Cancel account\n\ 
                                                                  {D9997E}Exit"
, "Select", ""); 
        else if ( 
P_DATA[ playerid ][ P_Logged ] == 1 && GetPVarInt( playerid, "MoneyReceived" ) == 1 ) 
            
ShowPlayerDialog( playerid, BANK, DIALOG_STYLE_LIST, ""COL_ALL"Banking System", "{FFF1EB}Deposit\n\ 
                                                                  {FFF1EB}Withdraw\n\ 
                                                                  {FFF1EB}Transfer\n\ 
                                                                  {FFF1EB}Account Information\n\ 
                                                                  {FFF1EB}Banking System Information\n\ 
                                                                  {FFF1EB}Cancel account\n\ 
                                                                  {9CFFC2}Receive Transfer\n\ 
                                                                  {D9997E}Exit"
, "Select", ""); 
        return 
1; 
    }
return 
1;
}
    return 
0; 
} 
ty worked.