PDA

View Full Version : Progress bar help!


TheTerminator
08/01/2015, 02:54 PM
I've recently taken up trying to make a hunger / thirst bar.
But I can't make the include files to work.

http://forum.sa-mp.com/showthread.php?t=113443

From here, I got the newest versions, the "progress2" ones, but after I #include <progress2>

I get these errors:

C:\Users\User\Desktop\samp03z_svr_R1_win32\gamemod es\HungerScript.pwn(15) : error 017: undefined symbol "INVALID_BAR_ID"
C:\Users\User\Desktop\samp03z_svr_R1_win32\gamemod es\HungerScript.pwn(33) : error 017: undefined symbol "CreateProgressBar"
C:\Users\User\Desktop\samp03z_svr_R1_win32\gamemod es\HungerScript.pwn(33) : warning 213: tag mismatch
C:\Users\User\Desktop\samp03z_svr_R1_win32\gamemod es\HungerScript.pwn(35) : warning 217: loose indentation
C:\Users\User\Desktop\samp03z_svr_R1_win32\gamemod es\HungerScript.pwn(47) : warning 217: loose indentation
C:\Users\User\Desktop\samp03z_svr_R1_win32\gamemod es\HungerScript.pwn(51) : error 017: undefined symbol "DestroyProgressBar"
C:\Users\User\Desktop\samp03z_svr_R1_win32\gamemod es\HungerScript.pwn(52) : warning 217: loose indentation
C:\Users\User\Desktop\samp03z_svr_R1_win32\gamemod es\HungerScript.pwn(57) : error 017: undefined symbol "SetProgressBarValue"
C:\Users\User\Desktop\samp03z_svr_R1_win32\gamemod es\HungerScript.pwn(58) : error 017: undefined symbol "UpdateProgressBar"
C:\Users\User\Desktop\samp03z_svr_R1_win32\gamemod es\HungerScript.pwn(59) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.

Thank you for your help in advance.

Sid_Alexander
08/01/2015, 03:00 PM
Open up the include, And add this on top and see how many actual errors you have and post them here

#pragma tabsize 0

TheTerminator
08/01/2015, 03:02 PM
C:\Users\User\Desktop\samp03z_svr_R1_win32\gamemod es\HungerScript.pwn(16) : error 017: undefined symbol "INVALID_BAR_ID"
C:\Users\User\Desktop\samp03z_svr_R1_win32\gamemod es\HungerScript.pwn(34) : error 017: undefined symbol "CreateProgressBar"
C:\Users\User\Desktop\samp03z_svr_R1_win32\gamemod es\HungerScript.pwn(34) : warning 213: tag mismatch
C:\Users\User\Desktop\samp03z_svr_R1_win32\gamemod es\HungerScript.pwn(52) : error 017: undefined symbol "DestroyProgressBar"
C:\Users\User\Desktop\samp03z_svr_R1_win32\gamemod es\HungerScript.pwn(58) : error 017: undefined symbol "SetProgressBarValue"
C:\Users\User\Desktop\samp03z_svr_R1_win32\gamemod es\HungerScript.pwn(59) : error 017: undefined symbol "UpdateProgressBar"

Sid_Alexander
08/01/2015, 03:03 PM
When you remove the progress bar include, Does it still show these errors? Are these errors in your script or in the include while compiling?

EDIT: Try compiling the include before using it.

TheTerminator
08/01/2015, 03:07 PM
LINE 16: new Bar:Hunger[MAX_PLAYERS] = {INVALID_BAR_ID, ...};
LINE 34: Hunger[playerid] = CreateProgressBar(549.00, 60.00, 57.50, 3.20, -16776961, 100.0);
LINE 34: -same as before-
LINE 52: DestroyProgressBar(Hunger[playerid]);
LINE 58: SetProgressBarValue(Hunger[playerid], Hungry[ playerid ] * 10.0);
LINE 59: UpdateProgressBar(Hunger[playerid], playerid);

Sid_Alexander
08/01/2015, 03:11 PM
Compile the include and check for any errors in it before using it on the script.

TheTerminator
08/01/2015, 03:16 PM
Include has no issues when compiling. I tried again, still getting error.s

Sid_Alexander
08/01/2015, 03:20 PM
Include has no issues when compiling. I tried again, still getting error.s

Remove every code of the progress bar and compile please.

TheTerminator
08/01/2015, 03:33 PM
If I remove each and every one of the codes then there won't be a problem.
Because there's no code to make a problem.

Larceny
08/01/2015, 03:34 PM
The progress2 uses player textdraw (http://wiki.sa-mp.com/wiki/CreatePlayerTextDraw).
You'll need to update your code to the new functions.

See https://github.com/Southclaw/progress2 for documentation.

Btw, you should consider indenting your code properly instead of telling the compiler to accept bad code(#pragma tabsize).

TheTerminator
08/01/2015, 03:35 PM
Here's the script I was testing it out with.

http://pastebin.com/senxRs4b