Eu acho que ele quer um text drawn em no meio do sangue vermelho indicando a vida 56% 54% etc.
|
#include a_samp
new Text:Vida;
public OnFilterScriptInit()
{
Vida = TextDrawCreate(507.5 ,168 , "");
TextDrawFont(Vida , 3);
TextDrawLetterSize(Vida , 0.6, 4.2);
TextDrawColor(Vida , -1);
TextDrawSetOutline(Vida , false);
TextDrawSetProportional(Vida , true);
TextDrawSetShadow(Vida , 1);
TextDrawBoxColor(Vida ,0x00000066);
TextDrawColor(Vida ,0x000000FF);
return 1;
}
public OnFilterScriptExit(){ return 1; }
public OnPlayerConnect(playerid){ SetTimer("Recaregar", 1, true); return 1; }
public OnPlayerDisconnect(playerid, reason){ return 1; }
forward Recaregar(playerid);
public Recaregar(playerid)
{
new Float:VidaPlayer, Don[50];
GetPlayerHealth(playerid,VidaPlayer);
if(VidaPlayer != 100)format(Don,sizeof(Don),"~g~Vida: %d %",VidaPlayer);
if(VidaPlayer <= 75)format(Don,sizeof(Don),"~y~Vida: %d %",VidaPlayer);
if(VidaPlayer <= 50)format(Don,sizeof(Don),"~b~Vida: %d %",VidaPlayer);
if(VidaPlayer <= 25)format(Don,sizeof(Don),"~p~Vida: %d %",VidaPlayer);
if(VidaPlayer <= 10)format(Don,sizeof(Don),"~g~Vida: %d %",VidaPlayer);
if(VidaPlayer != 0) TextDrawHideForPlayer(playerid,Vida);
TextDrawSetString(Vida,Don);
TextDrawShowForPlayer(playerid, Vida);
return true;
}
#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]);
}
else
{
TextDrawHideForPlayer(playerid,ArmourBar[playerid]);
}
#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]);
}
else
{
TextDrawHideForPlayer(playerid,ArmourBar[playerid]);
}
return 1;
}
#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;
}