[Pedido] contador de % de vida ou colete
#1

Iae Galera Ja procurei em tudo que era lugar mais nao achei vcs tem ou ja virao um contador de % de vida ou colete

Reply
#2

GetPlayerHealth ,,,, GetPlayerArmou , acho que й isso ve la na wiki.sa-mp.com
Reply
#3

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: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]);
        }
return 1;
}
Bom isto й uma base de que vocк precisa, depois remova as textdraw que nгo pertence a o contador de life e armour xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)