SA-MP Forums Archive
[Ajuda] erro em fs. - 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] erro em fs. (/showthread.php?tid=558606)



erro em fs. - chefaoBR - 18.01.2015

Erro em gm . alguem sabe como resolver , o significa esse erro ?

Quote:

(101) : error 030: compound statement not closed at the end of file (started at line 82)

PHP код:
forward AtualizarBars();
public 
AtualizarBars()
{
    for(new 
playeridplayerid<GetMaxPlayers(); playerid++)
    {
        if(
IsPlayerConnected(playerid)){                    //linha 82
            
new Float:Health;
            new 
HealthString[15];
            
GetPlayerHealth(playerid,Health);
            
format(HealthString15"       %d",floatround(Health));
            
TextDrawSetString(HealthBar[playerid],HealthString);
            
TextDrawShowForPlayer(playerid,HealthBar[playerid]);
            new 
Float:Armour;
            
GetPlayerArmour(playerid,Armour);
            if(
Armour 0)
            {
                new 
ArmourString[15];
                
format(ArmourString15"       %d",floatround(Armour));
                
TextDrawSetString(ArmourBar[playerid],ArmourString);
                
TextDrawShowForPlayer(playerid,ArmourBar[playerid]);
            }
            return 
1;
        }
//linha 101 с tem 



Re: erro em fs. - CLANdok - 18.01.2015

Tenta:
pawn Код:
forward AtualizarBars();
public AtualizarBars()
{
    for(new playerid; playerid<GetMaxPlayers(); playerid++)
    {

        if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, "Este player nгo estб conectado");
        new Float:Health;
        new HealthString[15];
        GetPlayerHealth(playerid,Health);
        format(HealthString, 15, "       %d",floatround(Health));
        TextDrawSetString(HealthBar[playerid],HealthString);
        TextDrawShowForPlayer(playerid,HealthBar[playerid]);
        new Float:Armour;
        GetPlayerArmour(playerid,Armour);
        if(Armour > 0){
            new ArmourString[15];
            format(ArmourString, 15, "       %d",floatround(Armour));
            TextDrawSetString(ArmourBar[playerid],ArmourString);
            TextDrawShowForPlayer(playerid,ArmourBar[playerid]);
        }
        return 1;
    }
}
Este erro indica que vocк abriu mas nгo fechou uma funзгo, quando for usar IsPlayerConnected use como eu fiz acima.