SA-MP Forums Archive
Need help!! - 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: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need help!! (/showthread.php?tid=472735)



Need help!! - Paween12802 - 30.10.2013

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


Re: Need help!! - SAMProductions - 30.10.2013

Try using this:

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

Functions:
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.



Re: Need help!! - Paween12802 - 30.10.2013

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

Just only how to make it be the verical progress sir