[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
#2

No pics then no clicks
Simple...
Reply
#3

Quote:
Originally Posted by SsHady
Посмотреть сообщение
No pics then no clicks
Simple...
Yaps btw its nice
Reply
#4

LOL why don't you upload whole code

#include <progress> LOL there is no include anywhere
Reply
#5

Include: https://sampforum.blast.hk/showthread.php?tid=113443
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)