[FilterScript] Car Health in Progress Bar - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (
https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Car Health in Progress Bar (
/showthread.php?tid=481151)
Car Health in Progress Bar -
MadLeet - 14.12.2013
Yo,Releasing some little script.it will show car health in progress bar.
Код:
#include <a_samp>
#include <progress>
new Bar:health[MAX_PLAYERS] = {INVALID_BAR_ID, ...};
public OnFilterScriptInit()
{
SetTimer("Car", 1000, 1);
return 1;
}
forward Car();
public Car()
{
for(new playerid; playerid < MAX_PLAYERS; playerid++) foreach(Player, playerid)
{
new vehicleid;
if((vehicleid = GetPlayerVehicleID(playerid)) && health[playerid] != INVALID_BAR_ID)
{
new Float:health;
GetVehicleHealth(vehicleid, health);
SetProgressBarValue(health[playerid], health);
UpdateProgressBar(health[playerid], playerid);
}
}
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_DRIVER)
{
DestroyProgressBar(health[playerid]);
health[playerid] = INVALID_BAR_ID;
}
if(newstate == PLAYER_STATE_DRIVER)
{
health[playerid] = CreateProgressBar(600.5, 100.0, _, _, 0x00FF00FF, 1000.0);
ShowProgressBarForPlayer(playerid, health[playerid]);
}
return 1;
}
Re: Car Health in Progress Bar -
SsHady - 14.12.2013
No pics then no clicks
Simple...
Re: Car Health in Progress Bar -
Stgnature - 14.12.2013
Quote:
Originally Posted by SsHady
No pics then no clicks
Simple...
|
Yaps btw its nice
Re: Car Health in Progress Bar -
kalanerik99 - 14.12.2013
LOL why don't you upload whole code
#include <progress> LOL there is no include anywhere
Re: Car Health in Progress Bar -
MadLeet - 14.12.2013
Include:
https://sampforum.blast.hk/showthread.php?tid=113443