SA-MP Forums Archive
[Include] L_ProgressBar v0.1 - 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)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] L_ProgressBar v0.1 (/showthread.php?tid=328180)



L_ProgressBar v0.1 - LuisGraph - 24.03.2012

I show L_ProgressBar which will help them create bar loaders as in windows, great for adding effects to functions that require load.

Functions
pawn Код:
SetPlayerProgressBar(playerid, Float:X, Float:Y, interval, name[]);
DestroyBarToPlayer(playerid);
IsPlayerBarCharged(playerid);

SetPlayerProgressBar(playerid, Float:X, Float:Y, interval, name[]);


-playerid: Id player that will create a bar
-Float:X and Float:Y: Coordinates of the screen location
-interval: velocity to be charged in milliseconds
-name:Name to display the bar

DestroyBarToPlayer(playerid);

The bar will destroy a player

IsPlayerBarCharged(playerid);

Check if the player already loaded bar

Test

[ame="http://www.youtube.com/watch?v=skH8xKRbY18"]http://www.youtube.com/watch?v=skH8xKRbY18[/ame]


Re: L_ProgressBar v0.1 - Guilherme_. - 24.03.2012

Nice !


Re: L_ProgressBar v0.1 - Delete_ - 24.03.2012

put an example of using the system


Respuesta: L_ProgressBar v0.1 - LuisGraph - 24.03.2012

pawn Код:
new Timer[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
    SetPlayerProgressBar(playerid, 150.0, 200.0, 100, "Charged Acount");
    Timer[playerid] = SetTimerEx("Check", 100, true, "i", playerid);
}
forward Check(playerid);
public Check(playerid)
{
    if(IsPlayerBarCharged(playerid))
    {
         SendClientMessage(playerid, -1, "Ready");
         KillTimer(Timer[playerid]);
    }
}



Re: L_ProgressBar v0.1 - Delete_ - 24.03.2012

Nice, +rep


Re: L_ProgressBar v0.1 - RuSke - 24.03.2012

Nice 10/10


Re: L_ProgressBar v0.1 - Hiddos - 24.03.2012

Not bad, but I suggest you adding a callback which gets called when the bar is filled and a function that allows you to get the charge amount (like 50 or 68 when it's not fully loaded).


Respuesta: Re: L_ProgressBar v0.1 - LuisGraph - 24.03.2012

Quote:
Originally Posted by Hiddos
Посмотреть сообщение
Not bad, but I suggest you adding a callback which gets called when the bar is filled and a function that allows you to get the charge amount (like 50 or 68 when it's not fully loaded).
good idea, in the next update.

Tankz guys.


Re: L_ProgressBar v0.1 - TheArcher - 24.03.2012

I was thinking to a thing like this. Just amazing. Good job.


Re: L_ProgressBar v0.1 - Geryy - 25.03.2012

LuisGraph, Add one more parameter:

SetPlayerProgressBar(playerid, Float:X, Float:Y, interval, name[], count);

like this:

SetPlayerProgressBar(playerid, Float:X, Float:Y, interval, name[], 0);

ProgressBar counts from 0 up to 100%

or

SetPlayerProgressBar(playerid, Float:X, Float:Y, interval, name[], 50);

ProgressBar counts from 50 up to 100%


Re: L_ProgressBar v0.1 - Michael@Belgium - 25.03.2012

Not bad Keep working on this !

EDIT: on my screen 100% looks like this lol:




Respuesta: L_ProgressBar v0.1 - LuisGraph - 25.03.2012

lol why is that? same thing happened to me in the 0.3e


Re: L_ProgressBar v0.1 - Lucas_Alemao - 26.03.2012

Very Nice.