18.05.2016, 17:26
PHP код:
public OnPlayerConnect(playerid)
{
hdisplay[playerid] = TextDrawCreate(505.625000, 427.583404, "Health:");
TextDrawLetterSize(hdisplay[playerid], 0.469375, 2.020000);
TextDrawAlignment(hdisplay[playerid], 1);
TextDrawColor(hdisplay[playerid], -5963521);
TextDrawSetShadow(hdisplay[playerid], 0);
TextDrawSetOutline(hdisplay[playerid], 1);
TextDrawBackgroundColor(hdisplay[playerid], 51);
TextDrawFont(hdisplay[playerid], 1);
TextDrawSetProportional(hdisplay[playerid], 1);
return 1;
}
Код:
public OnPlayerConnect(playerid) { hdisplay[playerid] = TextDrawCreate(505.625000, 427.583404, "Health:"); TextDrawLetterSize(hdisplay[playerid], 0.469375, 2.020000); TextDrawAlignment(hdisplay[playerid], 1); TextDrawColor(hdisplay[playerid], -5963521); TextDrawSetShadow(hdisplay[playerid], 0); TextDrawSetOutline(hdisplay[playerid], 1); TextDrawBackgroundColor(hdisplay[playerid], 51); TextDrawFont(hdisplay[playerid], 1); TextDrawSetProportional(hdisplay[playerid], 1); return 1; }
PHP код:
public OnPlayerEnterVehicle(playerid, vehicleid)
{
new Float: health, szText[10];
GetVehicleHealth(vehicleid, health);
format(szText, sizeof (szText), "%.2f", health);
PlayerTextDrawSetString(playerid, hdisplay[playerid], szText);
PlayerTextDrawShow(playerid, hdisplay[playerid]);
return 1;
}
Код:
public OnPlayerEnterVehicle(playerid, vehicleid) { new Float: health, szText[10]; GetVehicleHealth(vehicleid, health); format(szText, sizeof (szText), "%.2f", health); PlayerTextDrawSetString(playerid, hdisplay[playerid], szText); PlayerTextDrawShow(playerid, hdisplay[playerid]); return 1; }