SA-MP Forums Archive
Need some Help here :( - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need some Help here :( (/showthread.php?tid=276461)



Need some Help here :( - Soumi - 13.08.2011

Hello everyone, i have a problem with the Progress Bars creator, i have successfully made a Hunger Bar But when i'm trying to update on a one second timer, it doesn't work with this code

pawn Код:
SetProgressBarValue(HungerBar[i], -5.0);
UpdateProgressBar(HungerBar[i], i);
But works when i make set the value to positive, for example 5.0, can you help me?


Re: Need some Help here :( - Raimis_R - 13.08.2011

If you have function like GetProgressBarValue then you can try:

pawn Код:
SetProgressBarValue(HungerBar[i], GetProgressBarValue(HungerBar[i]) -5.0 );



Re: Need some Help here :( - Soumi - 13.08.2011

Not working, thanks anyway...


Re: Need some Help here :( - Raimis_R - 13.08.2011

You can try this version( for me better ) :

pawn Код:
new
    Float:BarValue[ MAX_PLAYERS ];

stock SetBarValue( playerid, Float:ammount )
{
    BarValue[ playerid ] += ammount;
    SetProgressBarValue( barID, BarValue[ playerid ] );
    return UpdateProgressBar( barID, playerid );
}
USE:

pawn Код:
SetBarValue( playerid, -5.0 );
But you need edit something in stock! ( I mean barID to ur barID )

Or better

pawn Код:
stock SetBarValue( playerid, barID, Float:ammount )
{
    BarValue[ playerid ] += ammount;
    SetProgressBarValue( barID, BarValue[ playerid ] );
    return UpdateProgressBar( barID, playerid );
}



Re: Need some Help here :( - Soumi - 13.08.2011

This is not working too...