[Ajuda] Bug no FilterScripter
#1

Bom estou com essa FS que peguei de um amigo e tem um bug nela, vejam:



Como podem ver buga a barinha da lataria do carro, mas ai й que ta pq eu queria retirar ela pois lataria ja tem no meu sistema de velocimetro, Help.

FS:

pawn Код:
#include <a_samp>
//news dos textdraws
new Text:Textdraw0;
new hourtwohaha, minutetwohaha;
new Text:HealthBar[MAX_PLAYERS];
new Text:ArmourBar[MAX_PLAYERS];
new Text:VehHealthBar[MAX_PLAYERS];
new Text:VehHealthBox1[MAX_PLAYERS];
new Text:VehHealthBox3[MAX_PLAYERS];
new Text:VehHealthBox2[MAX_PLAYERS];
new Text:TextDrawDetorn;

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
AddPlayerClass(280,1594.3829,-1675.4155,5.8906,265.8557,23,9999999,25,9999999,31,9999999); //policia militar
SetTimer("AtualizarBars",1000,true);
return 1;
}

public OnPlayerConnect(playerid)
{
        HealthBar[playerid] = TextDrawCreate(548.000000, 66.000000, "100");
        TextDrawBackgroundColor(HealthBar[playerid], 255);
        TextDrawFont(HealthBar[playerid], 1);
        TextDrawLetterSize(HealthBar[playerid], 0.280000, 1.000000);
        TextDrawColor(HealthBar[playerid], -1);
        TextDrawSetOutline(HealthBar[playerid], 1);
        TextDrawSetProportional(HealthBar[playerid], 1);

        ArmourBar[playerid] = TextDrawCreate(548.000000, 43.000000, "100");
        TextDrawBackgroundColor(ArmourBar[playerid], 255);
        TextDrawFont(ArmourBar[playerid], 1);
        TextDrawLetterSize(ArmourBar[playerid], 0.290000, 1.100000);
        TextDrawColor(ArmourBar[playerid], -1);
        TextDrawSetOutline(ArmourBar[playerid], 1);
        TextDrawSetProportional(ArmourBar[playerid], 1);

        VehHealthBox1[playerid] = TextDrawCreate(547.000000, 9.000000, "..........");
        TextDrawBackgroundColor(VehHealthBox1[playerid], 255);
        TextDrawFont(VehHealthBox1[playerid], 3);
        TextDrawLetterSize(VehHealthBox1[playerid], 0.599999, 3.999999);
        TextDrawColor(VehHealthBox1[playerid], 255);
        TextDrawSetOutline(VehHealthBox1[playerid], 1);
        TextDrawSetProportional(VehHealthBox1[playerid], 1);

        VehHealthBox2[playerid] = TextDrawCreate(549.000000, 22.000000, "~g~..........");
        TextDrawBackgroundColor(VehHealthBox2[playerid], 912665855);
        TextDrawFont(VehHealthBox2[playerid], 3);
        TextDrawLetterSize(VehHealthBox2[playerid], 0.560000, 2.200000);
        TextDrawColor(VehHealthBox2[playerid], -1);
        TextDrawSetOutline(VehHealthBox2[playerid], 1);
        TextDrawSetProportional(VehHealthBox2[playerid], 1);

        VehHealthBox3[playerid] = TextDrawCreate(549.000000, 22.000000, "~g~~h~.........");
        TextDrawBackgroundColor(VehHealthBox3[playerid], 1369064191);
        TextDrawFont(VehHealthBox3[playerid], 3);
        TextDrawLetterSize(VehHealthBox3[playerid], 0.560000, 2.200000);
        TextDrawColor(VehHealthBox3[playerid], -1);
        TextDrawSetOutline(VehHealthBox3[playerid], 1);
        TextDrawSetProportional(VehHealthBox3[playerid], 1);

        Textdraw0 = TextDrawCreate(532.000000, 405.000000, "ELEMENT OFICIAL");
        TextDrawBackgroundColor(Textdraw0, 255);
        TextDrawFont(Textdraw0, 1);
        TextDrawLetterSize(Textdraw0, 0.359998, 2.099998);
        TextDrawColor(Textdraw0, -7601921);
        TextDrawSetOutline(Textdraw0, 1);
        TextDrawSetProportional(Textdraw0, 1);

        VehHealthBar[playerid] = TextDrawCreate(548.000000, 32.000000, "100");
        TextDrawBackgroundColor(VehHealthBar[playerid], 255);
        TextDrawFont(VehHealthBar[playerid], 1);
        TextDrawLetterSize(VehHealthBar[playerid], 0.290000, 1.100000);
        TextDrawColor(VehHealthBar[playerid], -1);
        TextDrawSetOutline(VehHealthBar[playerid], 1);
        TextDrawSetProportional(VehHealthBar[playerid], 1);
        gettime(hourtwohaha, minutetwohaha);
        SetPlayerTime(playerid,hourtwohaha,minutetwohaha);
        return 1;
}

public OnPlayerSpawn(playerid)
{
TextDrawShowForPlayer(playerid, TextDrawDetorn);
return 1;
}

forward AtualizarBars();
public AtualizarBars()
{

        for(new playerid; playerid<GetMaxPlayers(); playerid++)
        {
        if(IsPlayerConnected(playerid))
        {
        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]);
        }
        else
        {
        TextDrawHideForPlayer(playerid,ArmourBar[playerid]);
        }
        if(IsPlayerInAnyVehicle(playerid))
        {
    new Float:VehHealth;
    new TrueVehHealth;
    new VehHealthString[15];
    GetVehicleHealth(GetPlayerVehicleID(playerid),VehHealth);
    TrueVehHealth = floatround(floatround(VehHealth - 250)/ 7.5);
    format(VehHealthString, 15, "       %d",floatround(TrueVehHealth));
    TextDrawSetString(VehHealthBar[playerid],VehHealthString);
    if (TrueVehHealth == -33)
        {
        TextDrawSetString(VehHealthBar[playerid],"     Morto");
        TextDrawSetString(VehHealthBox3[playerid],"~g~~h~");
        TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
        }
        else if (TrueVehHealth < 1)
        {
        TextDrawSetString(VehHealthBar[playerid],"     Fire");
        TextDrawSetString(VehHealthBox3[playerid],"~g~~h~");
        TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
        }
        else if (TrueVehHealth < 10)
        {
        TextDrawSetString(VehHealthBox3[playerid],"~g~~h~.");
        TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
        }
        else if (TrueVehHealth < 20)
        {
        TextDrawSetString(VehHealthBox3[playerid],"~g~~h~..");
        TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
        }
        else if (TrueVehHealth < 30)
        {
        TextDrawSetString(VehHealthBox3[playerid],"~g~~h~...");
        TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
        }
        else if (TrueVehHealth < 40)
        {
        TextDrawSetString(VehHealthBox3[playerid],"~g~~h~....");
        TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
        }
        else if (TrueVehHealth < 50)
        {
        TextDrawSetString(VehHealthBox3[playerid],"~g~~h~.....");
        TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
        }
        else if (TrueVehHealth < 60)
        {
        TextDrawSetString(VehHealthBox3[playerid],"~g~~h~......");
        TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
        }
        else if (TrueVehHealth < 70)
        {
        TextDrawSetString(VehHealthBox3[playerid],"~g~~h~.......");
        TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
        }
        else if (TrueVehHealth < 80)
        {
        TextDrawSetString(VehHealthBox3[playerid],"~g~~h~........");
        TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
        }
        else if (TrueVehHealth < 90)
        {
        TextDrawSetString(VehHealthBox3[playerid],"~g~~h~.........");
        TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
        }
        else if (TrueVehHealth < 100)
        {
        TextDrawSetString(VehHealthBox3[playerid],"~g~~h~..........");
        TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
        }
        else if (TrueVehHealth == 100)
        {
        TextDrawSetString(VehHealthBox3[playerid],"~g~~h~..........");
        TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
        }

        }
        else
        {
        TextDrawHideForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawHideForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawHideForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawHideForPlayer(playerid,VehHealthBar[playerid]);
        }
        }
        }
        return 1;
}

Crйditos do FS: "bom eu peguei assim, sem crйditos, pois meu amigo que me enviou".
Grato...
Reply
#2

Quote:
Originally Posted by _LorD_
Посмотреть сообщение
Bom estou com essa FS que peguei de um amigo e tem um bug nela, vejam:



Como podem ver buga a barinha da lataria do carro, mas ai й que ta pq eu queria retirar ela pois lataria ja tem no meu sistema de velocimetro, Help.

FS:

pawn Код:
#include <a_samp>
//news dos textdraws
new Text:Textdraw0;
new hourtwohaha, minutetwohaha;
new Text:HealthBar[MAX_PLAYERS];
new Text:ArmourBar[MAX_PLAYERS];
new Text:VehHealthBar[MAX_PLAYERS];
new Text:VehHealthBox1[MAX_PLAYERS];
new Text:VehHealthBox3[MAX_PLAYERS];
new Text:VehHealthBox2[MAX_PLAYERS];
new Text:TextDrawDetorn;

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
AddPlayerClass(280,1594.3829,-1675.4155,5.8906,265.8557,23,9999999,25,9999999,31,9999999); //policia militar
SetTimer("AtualizarBars",1000,true);
return 1;
}

public OnPlayerConnect(playerid)
{
        HealthBar[playerid] = TextDrawCreate(548.000000, 66.000000, "100");
        TextDrawBackgroundColor(HealthBar[playerid], 255);
        TextDrawFont(HealthBar[playerid], 1);
        TextDrawLetterSize(HealthBar[playerid], 0.280000, 1.000000);
        TextDrawColor(HealthBar[playerid], -1);
        TextDrawSetOutline(HealthBar[playerid], 1);
        TextDrawSetProportional(HealthBar[playerid], 1);

        ArmourBar[playerid] = TextDrawCreate(548.000000, 43.000000, "100");
        TextDrawBackgroundColor(ArmourBar[playerid], 255);
        TextDrawFont(ArmourBar[playerid], 1);
        TextDrawLetterSize(ArmourBar[playerid], 0.290000, 1.100000);
        TextDrawColor(ArmourBar[playerid], -1);
        TextDrawSetOutline(ArmourBar[playerid], 1);
        TextDrawSetProportional(ArmourBar[playerid], 1);

        VehHealthBox1[playerid] = TextDrawCreate(547.000000, 9.000000, "..........");
        TextDrawBackgroundColor(VehHealthBox1[playerid], 255);
        TextDrawFont(VehHealthBox1[playerid], 3);
        TextDrawLetterSize(VehHealthBox1[playerid], 0.599999, 3.999999);
        TextDrawColor(VehHealthBox1[playerid], 255);
        TextDrawSetOutline(VehHealthBox1[playerid], 1);
        TextDrawSetProportional(VehHealthBox1[playerid], 1);

        VehHealthBox2[playerid] = TextDrawCreate(549.000000, 22.000000, "~g~..........");
        TextDrawBackgroundColor(VehHealthBox2[playerid], 912665855);
        TextDrawFont(VehHealthBox2[playerid], 3);
        TextDrawLetterSize(VehHealthBox2[playerid], 0.560000, 2.200000);
        TextDrawColor(VehHealthBox2[playerid], -1);
        TextDrawSetOutline(VehHealthBox2[playerid], 1);
        TextDrawSetProportional(VehHealthBox2[playerid], 1);

        VehHealthBox3[playerid] = TextDrawCreate(549.000000, 22.000000, "~g~~h~.........");
        TextDrawBackgroundColor(VehHealthBox3[playerid], 1369064191);
        TextDrawFont(VehHealthBox3[playerid], 3);
        TextDrawLetterSize(VehHealthBox3[playerid], 0.560000, 2.200000);
        TextDrawColor(VehHealthBox3[playerid], -1);
        TextDrawSetOutline(VehHealthBox3[playerid], 1);
        TextDrawSetProportional(VehHealthBox3[playerid], 1);

        Textdraw0 = TextDrawCreate(532.000000, 405.000000, "ELEMENT OFICIAL");
        TextDrawBackgroundColor(Textdraw0, 255);
        TextDrawFont(Textdraw0, 1);
        TextDrawLetterSize(Textdraw0, 0.359998, 2.099998);
        TextDrawColor(Textdraw0, -7601921);
        TextDrawSetOutline(Textdraw0, 1);
        TextDrawSetProportional(Textdraw0, 1);

        VehHealthBar[playerid] = TextDrawCreate(548.000000, 32.000000, "100");
        TextDrawBackgroundColor(VehHealthBar[playerid], 255);
        TextDrawFont(VehHealthBar[playerid], 1);
        TextDrawLetterSize(VehHealthBar[playerid], 0.290000, 1.100000);
        TextDrawColor(VehHealthBar[playerid], -1);
        TextDrawSetOutline(VehHealthBar[playerid], 1);
        TextDrawSetProportional(VehHealthBar[playerid], 1);
        gettime(hourtwohaha, minutetwohaha);
        SetPlayerTime(playerid,hourtwohaha,minutetwohaha);
        return 1;
}

public OnPlayerSpawn(playerid)
{
TextDrawShowForPlayer(playerid, TextDrawDetorn);
return 1;
}

forward AtualizarBars();
public AtualizarBars()
{

        for(new playerid; playerid<GetMaxPlayers(); playerid++)
        {
        if(IsPlayerConnected(playerid))
        {
        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]);
        }
        else
        {
        TextDrawHideForPlayer(playerid,ArmourBar[playerid]);
        }
        if(IsPlayerInAnyVehicle(playerid))
        {
    new Float:VehHealth;
    new TrueVehHealth;
    new VehHealthString[15];
    GetVehicleHealth(GetPlayerVehicleID(playerid),VehHealth);
    TrueVehHealth = floatround(floatround(VehHealth - 250)/ 7.5);
    format(VehHealthString, 15, "       %d",floatround(TrueVehHealth));
    TextDrawSetString(VehHealthBar[playerid],VehHealthString);
    if (TrueVehHealth == -33)
        {
        TextDrawSetString(VehHealthBar[playerid],"     Morto");
        TextDrawSetString(VehHealthBox3[playerid],"~g~~h~");
        TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
        }
        else if (TrueVehHealth < 1)
        {
        TextDrawSetString(VehHealthBar[playerid],"     Fire");
        TextDrawSetString(VehHealthBox3[playerid],"~g~~h~");
        TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
        }
        else if (TrueVehHealth < 10)
        {
        TextDrawSetString(VehHealthBox3[playerid],"~g~~h~.");
        TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
        }
        else if (TrueVehHealth < 20)
        {
        TextDrawSetString(VehHealthBox3[playerid],"~g~~h~..");
        TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
        }
        else if (TrueVehHealth < 30)
        {
        TextDrawSetString(VehHealthBox3[playerid],"~g~~h~...");
        TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
        }
        else if (TrueVehHealth < 40)
        {
        TextDrawSetString(VehHealthBox3[playerid],"~g~~h~....");
        TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
        }
        else if (TrueVehHealth < 50)
        {
        TextDrawSetString(VehHealthBox3[playerid],"~g~~h~.....");
        TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
        }
        else if (TrueVehHealth < 60)
        {
        TextDrawSetString(VehHealthBox3[playerid],"~g~~h~......");
        TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
        }
        else if (TrueVehHealth < 70)
        {
        TextDrawSetString(VehHealthBox3[playerid],"~g~~h~.......");
        TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
        }
        else if (TrueVehHealth < 80)
        {
        TextDrawSetString(VehHealthBox3[playerid],"~g~~h~........");
        TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
        }
        else if (TrueVehHealth < 90)
        {
        TextDrawSetString(VehHealthBox3[playerid],"~g~~h~.........");
        TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
        }
        else if (TrueVehHealth < 100)
        {
        TextDrawSetString(VehHealthBox3[playerid],"~g~~h~..........");
        TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
        }
        else if (TrueVehHealth == 100)
        {
        TextDrawSetString(VehHealthBox3[playerid],"~g~~h~..........");
        TextDrawShowForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawShowForPlayer(playerid,VehHealthBar[playerid]);
        }

        }
        else
        {
        TextDrawHideForPlayer(playerid,VehHealthBox1[playerid]);
        TextDrawHideForPlayer(playerid,VehHealthBox2[playerid]);
        TextDrawHideForPlayer(playerid,VehHealthBox3[playerid]);
        TextDrawHideForPlayer(playerid,VehHealthBar[playerid]);
        }
        }
        }
        return 1;
}

Crйditos do FS: "bom eu peguei assim, sem crйditos, pois meu amigo que me enviou".
Grato...
Pelo que me consta essa barrinha й a verde, tente usar seu cуdigo assim:

pawn Код:
#include <a_samp>
//news dos textdraws
new Text:Textdraw0;
new Text:HealthBar[MAX_PLAYERS];
new Text:ArmourBar[MAX_PLAYERS];
new Text:TextDrawDetorn;

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
AddPlayerClass(280,1594.3829,-1675.4155,5.8906,265.8557,23,9999999,25,9999999,31,9999999); //policia militar
SetTimer("AtualizarBars",1000,true);
return 1;
}

public OnPlayerConnect(playerid)
{
        HealthBar[playerid] = TextDrawCreate(548.000000, 66.000000, "100");
        TextDrawBackgroundColor(HealthBar[playerid], 255);
        TextDrawFont(HealthBar[playerid], 1);
        TextDrawLetterSize(HealthBar[playerid], 0.280000, 1.000000);
        TextDrawColor(HealthBar[playerid], -1);
        TextDrawSetOutline(HealthBar[playerid], 1);
        TextDrawSetProportional(HealthBar[playerid], 1);

        ArmourBar[playerid] = TextDrawCreate(548.000000, 43.000000, "100");
        TextDrawBackgroundColor(ArmourBar[playerid], 255);
        TextDrawFont(ArmourBar[playerid], 1);
        TextDrawLetterSize(ArmourBar[playerid], 0.290000, 1.100000);
        TextDrawColor(ArmourBar[playerid], -1);
        TextDrawSetOutline(ArmourBar[playerid], 1);
        TextDrawSetProportional(ArmourBar[playerid], 1);

        Textdraw0 = TextDrawCreate(532.000000, 405.000000, "ELEMENT OFICIAL");
        TextDrawBackgroundColor(Textdraw0, 255);
        TextDrawFont(Textdraw0, 1);
        TextDrawLetterSize(Textdraw0, 0.359998, 2.099998);
        TextDrawColor(Textdraw0, -7601921);
        TextDrawSetOutline(Textdraw0, 1);
        TextDrawSetProportional(Textdraw0, 1);

        return 1;
}

public OnPlayerSpawn(playerid)
{
TextDrawShowForPlayer(playerid, TextDrawDetorn);
return 1;
}

forward AtualizarBars();
public AtualizarBars()
{

        for(new playerid; playerid<GetMaxPlayers(); playerid++)
        {
        if(IsPlayerConnected(playerid))
        {
        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]);
        }
        else
        {
        TextDrawHideForPlayer(playerid,ArmourBar[playerid]);
        }
        }
        }
        return 1;
}
Reply
#3

Sim, a Barrinha verde somiu, mas ainda tem um bug, tipo mostra la a vida digital( os numeros nela ), mas dps de um tempo some, estranho nao ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)