- เครดิต
- -221
- ความรู้
-
- เงิน $
-
- ความดี
-
|
stock UpdateBar(playerid)
{
new Float:HP,veh;
veh = GetPlayerVehicleID(playerid);
GetVehicleHealth(veh, HP);
UpdateString(HP);
UpdatePlayer3DTextLabelText(playerid, CarLabel[playerid], -1, UpdateString(HP));
return 1;
}
stock UpdateString(Float:HP)
{
new str[30];
if(HP == 1000) format(str,sizeof(str),"{00ff00}••••••••••");
else if(HP >= 900) format(str,sizeof(str),"{66ff00}•••••••••{ffffff}•");
else if(HP >= 800) format(str,sizeof(str),"{7fff00}••••••••{ffffff}••");
else if(HP >= 700) format(str,sizeof(str),"{ccff00}•••••••{ffffff}•••");
else if(HP >= 600) format(str,sizeof(str),"{f7f21a}••••••{ffffff}••••");
else if(HP >= 500) format(str,sizeof(str),"{f4c430}•••••{ffffff}•••••");
else if(HP >= 400) format(str,sizeof(str),"{e49b0f}••••{ffffff}••••••");
else if(HP >= 300) format(str,sizeof(str),"{e4650e}•••{ffffff}•••••••");
else if(HP >= 250) format(str,sizeof(str),"{ff2400}••{ffffff}••••••••");
else format(str,sizeof(str),"{ff2400}Boom!");
return str;
}
forward DeleteText(playerid);
public DeleteText(playerid)
{
KillTimer(timercar[playerid]);
LabelActive[playerid] = false;
UpdateBar(playerid);
CDamage[playerid]=0;
return 1;
} |
|