08.04.2018, 10:47
Quote:
PHP код:
PHP код:
|
PHP код:
new PlayerText:HealthTv[MAX_PLAYERS]; // add textdraw for all players
public OnPlayerConnect(playerid)
{
HealthTv[playerid] = CreatePlayerTextDraw(playerid,195.000000, 399.000000, "Health:");
PlayerTextDrawBackgroundColor(playerid,HealthTv[playerid], 255);
PlayerTextDrawFont(playerid,HealthTv[playerid], 1);
PlayerTextDrawLetterSize(playerid,HealthTv[playerid], 0.500000, 2.400000);
PlayerTextDrawColor(playerid,HealthTv[playerid], -16776961);
PlayerTextDrawSetOutline(playerid,HealthTv[playerid], 0);
PlayerTextDrawSetProportional(playerid,HealthTv[playerid], 1);
PlayerTextDrawSetShadow(playerid,HealthTv[playerid], 1);
PlayerTextDrawSetSelectable(playerid,HealthTv[playerid], 0);
return true;
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(GetPlayerState(i) == PLAYER_STATE_SPECTATING)
{
new stringtv[15],Float:health;
GetPlayerHealth(gSpectateID[i], health);
format(stringtv, sizeof(stringtv),"Health:%2.f",health);
PlayerTextDrawSetString(i,HealthTv[i],stringtv);
PlayerTextDrawShow(i,HealthTv[i]);
}
}