31.12.2014, 16:46
Hello, I've been working on a vehicle damage progress bar and I don't seem to be getting it working, I could use a little bit of help. thanks, code:
It is showing the bar, but it doesn't progress nor does it show the progression, it's just a blank bar, thanks if you're able to help me out here!
pawn Код:
#include <a_samp>
#include <progress>
new Bar:Vhealthbar[MAX_PLAYERS];
forward OnVehicleUpdate();
public OnFilterScriptInit()
{
for(new playerid; playerid < MAX_PLAYERS; playerid++)
{
Vhealthbar[playerid] = CreateProgressBar(500.00, 122.00, 106.50, 5.50, 16777215, 100.0);
}
return 1;
}
public OnFilterScriptExit()
{
for(new playerid; playerid < MAX_PLAYERS; playerid++)
{
DestroyProgressBar(Vhealthbar[playerid]);
}
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
ShowProgressBarForPlayer(playerid, Vhealthbar[playerid]);
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
HideProgressBarForPlayer(playerid, Vhealthbar[playerid]);
return 1;
}
public OnVehicleUpdate()
{
for(new playerid; playerid < MAX_PLAYERS; playerid++)
{
new Float:health, veh = GetPlayerVehicleID(playerid);
GetVehicleHealth(veh, health);
SetProgressBarValue(Vhealthbar[playerid], GetVehicleHealth(veh, health));
UpdateProgressBar(Vhealthbar[playerid], playerid);
return 1;
}
return 1;
}