В начало:
Code
new Text:Health[MAX_PLAYERS];
new Text:Armour[MAX_PLAYERS];
В public OnGameModeInit:
Code
for(new i = 0; i < MAX_PLAYERS; i++)
{
Health[i] = TextDrawCreate(580.000000, 67.000000, "100%");
TextDrawBackgroundColor(Health[i], 255);
TextDrawFont(Health[i], 1);
TextDrawLetterSize(Health[i], 0.219999, 0.899999);
TextDrawColor(Health[i], -1);
TextDrawSetOutline(Health[i], 1);
TextDrawSetProportional(Health[i], 1);
Armour[i] = TextDrawCreate(580.000000, 44.000000, "100%");
TextDrawBackgroundColor(Armour[i], 255);
TextDrawFont(Armour[i], 1);
TextDrawLetterSize(Armour[i], 0.219999, 0.899999);
TextDrawColor(Armour[i], -1);
TextDrawSetOutline(Armour[i], 1);
TextDrawSetProportional(Armour[i], 1);
}
SetTimer("vitals",1000,1);
В public OnPlayerSpawn:
Code
TextDrawShowForPlayer(playerid, Health[playerid]);
В конец мода, ну или куда-то, но главное не в средину паблика:
Code
forward vitals();
public vitals()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new string[5];
new Float:pHealth, Float:pArmour;
GetPlayerHealth(i,pHealth);
GetPlayerArmour(i,pArmour);
format(string, sizeof(string), "%.0f%", pHealth);
TextDrawSetString(Health[i], string);
format(string, sizeof(string), "%.0f%", pArmour);
TextDrawSetString(Armour[i], string);
if(pArmour == 0) TextDrawHideForPlayer(i, Armour[i]);
else TextDrawShowForPlayer(i, Armour[i]);
}
}
Автор: -Rebel Son-
Редактирование: LiOn4uK