SA-MP Forums Archive
[Ajuda] Unreachable code - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Unreachable code (/showthread.php?tid=623665)



Unreachable code - GuilhermeW - 03.12.2016

PHP код:
    if(strcmp(cmd, "/ColisaoE", true) == 0) < Linha do erro, somente essa
    
{
        if(
ColisaoE[playerid] == 0)
        {
        for(new 
e; e < MAX_PLAYERS; e++)
        {
        if(
FoiProEvento[playerid] == 1)
        
DisableRemoteVehicleCollisions(e, true);
        
SendClientMessage(playerid, COR_BRANCOXXX, "* Colisхes nos veнculos do evento desativadas!");
        
ColisaoE[playerid] = 1;
        return 
1;
        }
        }
        else
        {
        for(new 
e; e < MAX_PLAYERS; e++) {
        if(
FoiProEvento[playerid] == 1)
        
DisableRemoteVehicleCollisions(e, false);
        
SendClientMessage(playerid, COR_BRANCOXXX, "* Colisхes nos veнculos do evento ativadas!");
        
ColisaoE[playerid] = 0;
        return 
1;
        }
        } 
PHP код:
CM.pwn(56126) : warning 225: unreachable code 



Re: Unreachable code - [BOPE]Seu._.Madruga - 03.12.2016

PHP код:
    new ColisaoE = 0; //No topo do GM

    
if(strcmp(cmd, "/ColisaoE", true) == 0) //Comando Arrumado.
    
{
        
ColisaoE = ColisaoE == 0 ? (1) : (0);
        for(new 
e; e < MAX_PLAYERS; e++) {
            if(
FoiProEvento[e] == 1) {
                
DisableRemoteVehicleCollisions(e, ColisaoE == 0 ? (true) : (false));
                
SendClientMessage(e, COR_BRANCOXXX, ColisaoE == 0 ? ("* Colisхes nos veнculos do evento desativadas!") : ("* Colisхes nos veнculos do evento ativadas!"));
            }
        }
        return 
1;
    }