Need help!!
#1

Sir...---++

I wanna make the prograss bar but not the normal progress bar

I wanna make a vertical progress bar can u guys give me some tutorial or how to do

pawn code or anythings else

Thank please Sa-mps user

Sorry for my bad eng cuz i'ma thai
Reply
#2

Try using this:

Progress Bar 1.3.1
Pastebin for Player Progress Bars
Pastebin for Progress Bar Creator
GitHub for Player Progress Bars

Functions:
  • CreateProgressBar(x, y, width, height, color, max)

    Creates a progress bar (almost the same as TextDrawCreate).
    • x and y values are the position of the bar on the screen;
    • width and height are the size of the bar (they have default values, just put _ as parameter);
    • color is the bar color, obviously;
    • max is the max percentage the bar can reach (default 100).
    Returns: the created barid.
  • DestroyProgressBar(barid)

    Destroys a created bar.
  • ShowProgressBarForPlayer(playerid, barid)

    Simply shows the given progress bar for a player.
  • HideProgressBarForPlayer(playerid, barid)

    Hides the given progress bar from a player.
  • ShowProgressBarForAll(barid)

    Shows the given progress bar for all connected players.
  • HideProgressBarForAll(barid)

    Hides the given progress bar from all connected players.
  • SetProgressBarValue(barid, value)

    Changes the current percentage of the given progress bar (it's float point). Remember that the max value is the value you gave to it in CreateProgressBar.
  • GetProgressBarValue(barid)

    Get the current value of a progress bar.
    Note: it'll return INVALID_BAR_VALUE if the bar doesn't exist or if something goes wrong.
  • SetProgressBarMaxValue(barid, max)

    The max value is dynamic, you can change it whenever you want, and it'll update by itself (the current progress bar value stay the same, the difference you see in the bar).
  • SetProgressBarColor(barid, color)

    Sets the bar color to whatever you want. The include now supports transparent colors, so, be care on using AA or 00 as Alpha. If you want the color to be fully colored, use FF in the end of the color (i.e 0x00FF00FF).
    Everytime you use this function, you need to use the "UpdateProgressBar" function, see above.
  • UpdateProgressBar(barid, playerid=INVALID_PLAYER_ID)

    Everytime you change a progress bar value or color, you need to update it. I didn't include this function directly in SetProgressBarValue/SetProgressBarColor, because it's not efficient in this way.
    You can simply not use the playerid parameter, and the progress bar will update for everyone.
Use:

Simple Progress Bar Creation:

Код:
new Bar:health = CreateProgressBar(50.0, 300.0, _, _, 0xFF0000FF, 100.0);
SetProgressBarValue(health, 50.0);
ShowProgressBarForAll(health);
and If you want to Destroy the Progress Bar:

Код:
DestroyProgressBar(health);
Example:

The Example Script:

Код:
#include <a_samp>
#include <progress>

new Bar:vhealth[MAX_PLAYERS] = {INVALID_BAR_ID, ...};
forward ProgressBar();

public OnFilterScriptInit()
{
    SetTimer("ProgressBar", 500, 1);
    return 1;
}

public ProgressBar() //I prefer not to use OnPlayerUpdate with textdraws
{
    for(new playerid; playerid < MAX_PLAYERS; playerid++) //I recommend foreach(Player, playerid)
    {
        new vehicleid;
        if((vehicleid = GetPlayerVehicleID(playerid)) && vhealth[playerid] != INVALID_BAR_ID)
        {
            new Float:health;
            GetVehicleHealth(vehicleid, health);
            SetProgressBarValue(vhealth[playerid], health);
            UpdateProgressBar(vhealth[playerid], playerid);
        }
    }
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(oldstate == PLAYER_STATE_DRIVER)
    {
        DestroyProgressBar(vhealth[playerid]);
        vhealth[playerid] = INVALID_BAR_ID;
    }
    if(newstate == PLAYER_STATE_DRIVER)
    {
        vhealth[playerid] = CreateProgressBar(548.5, 36.0, _, _, 0x00FF00FF, 1000.0);
        ShowProgressBarForPlayer(playerid, vhealth[playerid]);
    }
    return 1;
}
How to install ? :
  1. Copy the whole include codes in Notepad, Wordpad, etc..
  2. Save it as "include's name.inc", and Save it in "pawno > include". (for example "progress.inc")
  3. Open your Gamemode Script using PAWNO Compiler.
  4. Add "#include <include's name>" at the Top of your Gamemode Script. (for example "#include <progress>")
  5. Compile it, Save it, and Finish.
Reply
#3

Can u make it easilier---**---

Just only how to make it be the verical progress sir
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)