progress bar help
#2

You have got function OnVehicleUpdate, but you never call it. You have to set timer

Код:
public OnFilterScriptInit()
{
	return SetTimer("OnVehicleUpdate", 1000, 1);
}

forward OnVehicleUpdate();
public OnVehicleUpdate()
{
	new Float:health;

	for(new playerid; playerid != MAX_PLAYERS; playerid++)
	{
		if(!IsPlayerConnected(playerid) || !IsPlayerInAnyVehicle(playerid)) continue;

		GetVehicleHealth(GetPlayerVehicleID(playerid), health);
		SetProgressBarValue(Vhealthbar[playerid], health);
		UpdateProgressBar(Vhealthbar[playerid], playerid);
	}
}
Not tested, should work. Also i recommend show progress bar in callback OnPlayerStateChange, not in OnPlayerEnterVehicle - this callback is called when a player begins to enter a vehicle.
Reply


Messages In This Thread
progress bar help - by LeXuZ - 31.12.2014, 16:46
Re: progress bar help - by ball - 31.12.2014, 18:26
Re: progress bar help - by LeXuZ - 31.12.2014, 19:57
Re: progress bar help - by LeXuZ - 01.01.2015, 19:21
Re: progress bar help - by ball - 01.01.2015, 20:37
Re: progress bar help - by LeXuZ - 01.01.2015, 20:58
Re: progress bar help - by Schneider - 01.01.2015, 21:02
Re: progress bar help - by ball - 01.01.2015, 21:16
Re: progress bar help - by LeXuZ - 01.01.2015, 23:53

Forum Jump:


Users browsing this thread: 2 Guest(s)