Versão 2.0
- Código:
#define COR_TEXTDRAW00 0xE6E6FAFF //aqui você vai colocar a cor do textdraw em hexadecimal.
#define COR_TEXTDRAW01 0xE6E6FAFF //aqui você vai colocar a cor do textdraw em hexadecimal.
- Código:
//=========================== [ Includes ] =====================================
#include <a_samp>
#define COR_TEXTDRAW00 0xE6E6FAFF //aqui você vai colocar a cor do textdraw em hexadecimal.
#define COR_TEXTDRAW01 0xE6E6FAFF //aqui você vai colocar a cor do textdraw em hexadecimal.
//========================== [ News ] ==========================================
new PlayerText:vida[MAX_PLAYERS];
new PlayerText:colete[MAX_PLAYERS];
new Total[6];
new Total2[6];
public OnFilterScriptInit()
{
print("FilterScript de mostra vida/colete em números feito por Marllun");
return 1;
}
public OnPlayerConnect(playerid)
{
vida[playerid] = CreatePlayerTextDraw(playerid,562.000000, 67.000000, " ");
PlayerTextDrawBackgroundColor(playerid,vida[playerid], 255);
PlayerTextDrawFont(playerid,vida[playerid], 1);
PlayerTextDrawLetterSize(playerid,vida[playerid], 0.290000, 0.899999);
PlayerTextDrawColor(playerid,vida[playerid], COR_TEXTDRAW00);
PlayerTextDrawSetOutline(playerid,vida[playerid], 0);
PlayerTextDrawSetProportional(playerid,vida[playerid], 1);
PlayerTextDrawSetShadow(playerid,vida[playerid], 1);
PlayerTextDrawSetString(playerid,vida[playerid],Total);
colete[playerid] = CreatePlayerTextDraw(playerid,562.000000, 44.000000, " ");
PlayerTextDrawBackgroundColor(playerid,colete[playerid], 255);
PlayerTextDrawFont(playerid,colete[playerid], 1);
PlayerTextDrawLetterSize(playerid,colete[playerid], 0.290000, 0.899999);
PlayerTextDrawColor(playerid,colete[playerid], COR_TEXTDRAW01);
PlayerTextDrawSetOutline(playerid,colete[playerid], 0);
PlayerTextDrawSetProportional(playerid,colete[playerid], 1);
PlayerTextDrawSetShadow(playerid,colete[playerid], 1);
PlayerTextDrawSetString(playerid,colete[playerid],Total2);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
PlayerTextDrawHide(playerid,vida[playerid]);
PlayerTextDrawHide(playerid,colete[playerid]);
return 1;
}
public OnPlayerSpawn(playerid)
{
PlayerTextDrawShow(playerid,vida[playerid]);
PlayerTextDrawShow(playerid,colete[playerid]);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
PlayerTextDrawHide(playerid,vida[playerid]);
PlayerTextDrawHide(playerid,colete[playerid]);
return 1;
}
public OnPlayerUpdate(playerid)
{
new Float:vida2;
new Float:colete2;
for(new i; i < MAX_PLAYERS; i++)
{
GetPlayerArmour(i,colete2);
if(colete2 < 1) PlayerTextDrawHide(playerid,colete[playerid]);
if(colete2 > 0) PlayerTextDrawShow(playerid,colete[playerid]);
GetPlayerHealth(i,vida2);
format(Total, sizeof(Total), "%0.1f",vida2);
GetPlayerArmour(i,colete2);
format(Total2, sizeof(Total2), "%0.1f",colete2);
//Textdrawstrings
PlayerTextDrawSetString(i,vida[i],Total);
PlayerTextDrawSetString(i,colete[i],Total2);
return 1;
}
return 1;
}