11/08/2022 16:18
Gostaria de trocar a cor de acordo com o dano do veiculo, me tomei como base um por texto, mas não consigo mudar a Box.
Código:
Dano = CreatePlayerTextDraw(playerid, 634.000000, 385.000000, "_");
PlayerTextDrawBackgroundColor(playerid, Dano, 255);
PlayerTextDrawFont(playerid, Dano, 1);
PlayerTextDrawLetterSize(playerid, Dano, -7.233323, 2.949994);
PlayerTextDrawColor(playerid, Dano, -1);
PlayerTextDrawSetOutline(playerid, Dano, 0);
PlayerTextDrawSetProportional(playerid, Dano, 1);
PlayerTextDrawSetShadow(playerid, Dano, 1);
PlayerTextDrawUseBox(playerid, Dano, 1);
PlayerTextDrawBoxColor(playerid, Dano, -54394625);
PlayerTextDrawAlignment(playerid, Dano, 2);
PlayerTextDrawTextSize(playerid, Dano, 413.000000, 1.500000);
Código:
if(health <= 300)
{
PlayerTextDrawBoxColor(playerid, Dano, 9109759);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(veh, engine, lights, alarm, doors, bonnet, boot, objective);
// if(engine == VEHICLE_PARAMS_ON)
// {
// SendClientMessage(playerid, COLOR_RED, "* O motor do veículo parou de funcionar");
// SetVehicleParamsEx(veh, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
// }
}
else if(health <= 600) PlayerTextDrawBoxColor(playerid, Dano, -764862721);
else PlayerTextDrawBoxColor(playerid, Dano, -1962934017);