SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 26/02/2020, 05:29 PM   #1
bookknp
Huge Clucker
 
bookknp's Avatar
 
Join Date: Dec 2013
Posts: 234
Reputation: 24
Question Progress2.inc problem

Hi guys, I'm trying to use progress2.inc to create a bar with two colors, but I don't know how it's done, can anyone help me? +rep

example:

bookknp is offline   Reply With Quote
Old 26/02/2020, 10:06 PM   #2
jasperschellekens
Gangsta
 
jasperschellekens's Avatar
 
Join Date: Dec 2016
Location: Gehenna
Posts: 810
Reputation: 79
Default Re: Progress2.inc problem

Looks like something they've made without the progress bar include because you can't do this with it. You can however change it to be able to do this.
__________________
Coming soon (5-21-2020):

Undead Wasteland Roleplay - The year is 1996. San Andreas is a wasteland ruled by the undead. the once so glorius landscape of San Andreas, is now a shattered decayed place that is only a vague memory of the world as we used to know it.
Official Live Beta Release Date: 21th of May, 2020
Discord
jasperschellekens is offline   Reply With Quote
Old 26/02/2020, 11:00 PM   #3
bookknp
Huge Clucker
 
bookknp's Avatar
 
Join Date: Dec 2013
Posts: 234
Reputation: 24
Default Re: Progress2.inc problem

Quote:
Originally Posted by jasperschellekens View Post
Looks like something they've made without the progress bar include because you can't do this with it. You can however change it to be able to do this.
Do you know how it's done? Could you tell me if they are two bars facing each other?

They are textdraw?

can you give me an example?
bookknp is offline   Reply With Quote
Old 27/02/2020, 12:11 AM   #4
JesterlJoker
Huge Clucker
 
Join Date: Apr 2015
Location: Cagayan de Oro, Philippines
Posts: 280
Reputation: 31
Default Re: Progress2.inc problem

I have an idea but I don't know if it helps..

You can overlap two textdraws for this.

Example keep the farmer textdraw behind the Mafia textdraw. You also have to make sure that they have the same size and width. Then keep the Mafia textdraw on top, or the other way around.

Then all you have to do is decrease and increase the textdraw on top, example the Mafia Textdraw. Mafia Textdraw should have 100 as max_value then the calculation formula should be mPercentage = (MafiaPlayers/TotalPlayers)*100, you can then keep changing the textdraw, or updating the textdraw, value to the new percentage. Believe me it won't go pass 100%
__________________

Testers are welcome just slide into my DM's.
JesterlJoker is offline   Reply With Quote
Old 27/02/2020, 12:39 AM   #5
algorhitmically
Little Clucker
 
Join Date: Feb 2020
Posts: 17
Reputation: 8
Default Re: Progress2.inc problem

I think that this is one bar with gray color and green foreground. You can do the calculations by adding up number of mafia members and number of farmers and then set max bar value to sum of farmers and mafia members. Then you can set the bar value to number of mafia members and you'll automatically get bar which looks exactly like this on the picture you attached. You just need to add textdraws above the bar (Farmers, Members text).
algorhitmically is offline   Reply With Quote
Old 27/02/2020, 02:06 AM   #6
SiaReyes
Gangsta
 
SiaReyes's Avatar
 
Join Date: Mar 2019
Location: Coordinates X,Y,Z
Posts: 621
Reputation: 57
Default Re: Progress2.inc problem

That is One Bar.

The Bar just increases/decreases MAFIA value according to Famers value.


Thread : https://forum.sa-mp.com/showthread.php?t=658380
Download Link : Click Here

Code:
SetProgressBar3DBackgroundColor(Bar3D:barid, background_color);
Set Background Color as Green

Code:
SetProgressBar3DFillColor(Bar3D:barid, fill_color)
Set Main color as Grey, and also "MAFIAS" and "FAMERS" are textdraws.

Last edited by SiaReyes; 27/02/2020 at 05:58 AM.
SiaReyes is offline   Reply With Quote
Old 27/02/2020, 03:39 PM   #7
bookknp
Huge Clucker
 
bookknp's Avatar
 
Join Date: Dec 2013
Posts: 234
Reputation: 24
Default Re: Progress2.inc problem

Quote:
Originally Posted by SiaReyes View Post
That is One Bar.

The Bar just increases/decreases MAFIA value according to Famers value.


Thread : https://forum.sa-mp.com/showthread.php?t=658380
Download Link : Click Here

Code:
SetProgressBar3DBackgroundColor(Bar3D:barid, background_color);
Set Background Color as Green

Code:
SetProgressBar3DFillColor(Bar3D:barid, fill_color)
Set Main color as Grey, and also "MAFIAS" and "FAMERS" are textdraws.
Hello, I wanted to ask you, what is the way to put a progress3D on the screen of a player without being seen by the other players and you see it.

How to place it on the screen?

Because it marks you an ​​coordinate x, y, z the Bar3D:CreateProgressBar3D,
It is a site set on the map.??
bookknp is offline   Reply With Quote
Old 27/02/2020, 03:49 PM   #8
jasperschellekens
Gangsta
 
jasperschellekens's Avatar
 
Join Date: Dec 2016
Location: Gehenna
Posts: 810
Reputation: 79
Default Re: Progress2.inc problem

You can use this dimension map to get the coords:
__________________
Coming soon (5-21-2020):

Undead Wasteland Roleplay - The year is 1996. San Andreas is a wasteland ruled by the undead. the once so glorius landscape of San Andreas, is now a shattered decayed place that is only a vague memory of the world as we used to know it.
Official Live Beta Release Date: 21th of May, 2020
Discord
jasperschellekens is offline   Reply With Quote
Old 27/02/2020, 04:27 PM   #9
bookknp
Huge Clucker
 
bookknp's Avatar
 
Join Date: Dec 2013
Posts: 234
Reputation: 24
Default Re: Progress2.inc problem

Quote:
Originally Posted by jasperschellekens View Post
You can use this dimension map to get the coords:

An example would be:

PHP Code:
new Float:xFloat:yFloat:z;
Bar3DCreateProgressBar3D (320+x240+y,  z??... 
and what value would Z have??
bookknp is offline   Reply With Quote
Old 27/02/2020, 06:05 PM   #10
jasperschellekens
Gangsta
 
jasperschellekens's Avatar
 
Join Date: Dec 2016
Location: Gehenna
Posts: 810
Reputation: 79
Default Re: Progress2.inc problem

3D progress bars have nothing to do with textdraws. You are probably using the wrong include then.
Take a look here: https://github.com/Southclaws/samp-p...erprogress.inc

Code:
CreatePlayerProgressBar(playerid, Float:x, Float:y, Float:width=55.5, Float:height=3.2, color, Float:max=100.0);
You do not require a Z axis for these textdraws.
This is about 3d progressbar, I doubt you'll be able to archive what you want with that:
https://forum.sa-mp.com/showthread.php?t=658380
__________________
Coming soon (5-21-2020):

Undead Wasteland Roleplay - The year is 1996. San Andreas is a wasteland ruled by the undead. the once so glorius landscape of San Andreas, is now a shattered decayed place that is only a vague memory of the world as we used to know it.
Official Live Beta Release Date: 21th of May, 2020
Discord
jasperschellekens is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
progress2.inc YouShootIDodge Scripting Help 3 07/05/2019 12:55 PM
ERROR Progress2 Daynox12 Scripting Help 8 19/05/2018 05:24 PM
[Ajuda] Não consigo compilar ''progress2'' Coruja Português/Portuguese 2 17/09/2016 11:33 AM
Progress2.inc warning fahlevy Scripting Help 4 14/02/2016 02:37 PM
Need Help with Progress2.inc SpikY_ Scripting Help 8 03/08/2015 01:22 PM


All times are GMT. The time now is 07:24 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.