[FilterScript] Car Health in Progress Bar
#1

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;
}
Reply


Messages In This Thread
Car Health in Progress Bar - by MadLeet - 14.12.2013, 12:59
Re: Car Health in Progress Bar - by SsHady - 14.12.2013, 15:34
Re: Car Health in Progress Bar - by Stgnature - 14.12.2013, 15:49
Re: Car Health in Progress Bar - by kalanerik99 - 14.12.2013, 16:12
Re: Car Health in Progress Bar - by MadLeet - 14.12.2013, 16:55

Forum Jump:


Users browsing this thread: 1 Guest(s)