kivadásztam neked (remélem jó) nekem így van
[pawn]#include <progress>
new Bar:vhealth[MAX_PLAYERS] = {INVALID_BAR_ID, ...};
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_DRIVER)
{
DestroyProgressBar(vhealth[playerid]);
vhealth[playerid] = INVALID_BAR_ID;
}
if(newstate == PLAYER_STATE_DRIVER)
{
vhealth[playerid] = CreateProgressBar(548.5, 36.0, _, _, 0x00FF00FF, 1000.0);
ShowProgressBarForPlayer(playerid, vhealth[playerid]);
}
return 1;
}
forward ProgressBar();
public ProgressBar()
{
for(new playerid; playerid < MAX_PLAYERS; playerid++)
{
new vehicleid;
if((vehicleid = GetPlayerVehicleID(playerid)) && vhealth[playerid] != INVALID_BAR_ID)
{
new Float:health;
GetVehicleHealth(vehicleid, health);
SetProgressBarValue(vhealth[playerid], health);
UpdateProgressBar(vhealth[playerid], playerid);
}
}
}[/pawn]