08.04.2018, 10:38
PHP код:
new PlayerText:HealthTv;
HealthTv = CreatePlayerTextDraw(playerid,195.000000, 399.000000, "Health:");
PlayerTextDrawBackgroundColor(playerid,HealthTv, 255);
PlayerTextDrawFont(playerid,HealthTv, 1);
PlayerTextDrawLetterSize(playerid,HealthTv, 0.500000, 2.400000);
PlayerTextDrawColor(playerid,HealthTv, -16776961);
PlayerTextDrawSetOutline(playerid,HealthTv, 0);
PlayerTextDrawSetProportional(playerid,HealthTv, 1);
PlayerTextDrawSetShadow(playerid,HealthTv, 1);
PlayerTextDrawSetSelectable(playerid,HealthTv, 0);
PHP код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new targ,stringtv[100];
new Float:health;
targ = gSpectateID[i]; //Spectate -ID player watched
GetPlayerHealth(targ, health);
if(GetPlayerState(i) == PLAYER_STATE_SPECTATING)
{
format(stringtv, sizeof(stringtv),"Health:%2.f ",health);
PlayerTextDrawSetString(i,PlayerText:HealthTv,stringtv);
PlayerTextDrawShow(i,PlayerText:HealthTv);
}
}
}