[Pomoc]Problem sa Progress.inc

Započeo Bakkal
11. Jul 2016.
1,098
pregleda
4
postova
JucyMonster
2
Rookie
11. Jul 2016.
Skripta koju koristim: Mod od 0
Detaljan opis problema:Kada pokusam da compile-am skriptu izadju mi errori:

C:\Users\-/-\Desktop\RP\pawno\include\progress.inc(86) : error 001: expected token: ";", but found "-identifier-"
C:\Users\-/-\Desktop\RP\pawno\include\progress.inc(350) : error 017: undefined symbol "pbar_Index@YSII_Ag"
C:\Users\-/-\Desktop\RP\pawno\include\progress.inc(350) : error 017: undefined symbol "pbar_Index@YSII_Ag"
C:\Users\-/-\Desktop\RP\pawno\include\progress.inc(350) : error 017: undefined symbol "pbar_Index@YSII_Ag"
C:\Users\-/-\Desktop\RP\pawno\include\progress.inc(350) : fatal error 107: too many error messages on one line

Na 86 liniji se nalaze define-ovi, a tacno na njoj je:

#define DIALOG_LOGIN                                  2

Na ovoj 350, se nalazi cr8 textdrawa...

new Text:LoginTD[ 1 ];

Dio skripte:Mislim da vam nece biti potrebna skripta, ali izvolite progress.inc

/*==============================================================================

Progress Bar 2.0.3

A SA:MP UI library for rendering progress bars used to visualise all
manner of data from health to a countdown timer.

Library originally written by Flávio Toribio: flavio_toribio@hotmail.com
Now maintained by Southclaw in version 2+ with new features.

==============================================================================*/

#if defined _progress2_included
#endinput
#endif

#if !defined _samp_included
#tryinclude
#if !defined _samp_included
#error could not locate a_samp.inc file, please check your server includes
#endif
#endif

#if !defined PB_DEBUG
#define PB_DEBUG (false)
#endif

#define _progress2_included
#define _progress2_version 0x203

#define MAX_PLAYER_BARS            (MAX_PLAYER_TEXT_DRAWS / 3)
#define INVALID_PLAYER_BAR_VALUE    (Float:0xFFFFFFFF)
#define INVALID_PLAYER_BAR_ID      (PlayerBar:-1)

#if PB_DEBUG == true
#define pb_debug(%0); printf(%0);
#else
#define pb_debug(%0);
#endif

/*==============================================================================

Setup

==============================================================================*/

enum
{
BAR_DIRECTION_RIGHT,
BAR_DIRECTION_LEFT,
BAR_DIRECTION_UP,
BAR_DIRECTION_DOWN
}

enum E_BAR_DATA
{
Float: pbar_posX,
Float: pbar_posY,
Float: pbar_width,
Float: pbar_height,
pbar_colour,
Float: pbar_maxValue,
Float: pbar_progressValue,
pbar_direction
}

enum E_BAR_TEXT_DRAW
{
PlayerText: pbar_back,
PlayerText: pbar_fill,
PlayerText: pbar_main
}

static
pbar_Data,
pbar_TextDraw;

#if defined _Y_ITERATE_LOCAL_VERSION
new Iterator:pbar_Index;
#else
static bool:pbar_Valid;
#endif

forward PlayerBar:CreatePlayerProgressBar(playerid, Float:x, Float:y, Float:width=55.5, Float:height=3.2, colour = 0xFF1C1CFF, Float:max=100.0, direction=BAR_DIRECTION_RIGHT);
forward Float:GetPlayerProgressBarValue(playerid, PlayerBar:barid);

/*==============================================================================

Utils

==============================================================================*/

stock Float:pb_percent(Float:x, Float:widthorheight, Float:max, Float:value, direction)
{
new Float:result;

switch(direction)
{
case BAR_DIRECTION_RIGHT:
result = ((x - 3.0) + (((((x - 2.0) + widthorheight) - x) / max) * value));

case BAR_DIRECTION_LEFT:
result = ((x - 1.0) - (((((x + 2.0) - widthorheight) - x) / max) * -value)) - 4.0;

case BAR_DIRECTION_UP:
result = -((((((widthorheight / 10.0) - 0.45) * 1.02) / max) * value) + 0.55);

case BAR_DIRECTION_DOWN:
result = ((((((widthorheight / 10.0) - 0.45) * 1.02) / max) * value) - 0.55);
}

return result;
}

stock _bar_NewID(playerid)
{
#if defined _Y_ITERATE_LOCAL_VERSION
return Iter_Free(pbar_Index);
#else
new i;

for(i = 0; i < MAX_PLAYER_BARS; i++)
{
if(!pbar_Valid)
break;
}

return (i == MAX_PLAYER_BARS) ? -1 : i;
#endif
}

/*==============================================================================

Core

==============================================================================*/

stock PlayerBar:CreatePlayerProgressBar(playerid, Float:x, Float:y, Float:width = 55.5, Float:height = 3.2, colour = 0xFF1C1CFF, Float:max = 100.0, direction = BAR_DIRECTION_RIGHT)
{
if(!IsPlayerConnected(playerid))
return INVALID_PLAYER_BAR_ID;

new barid = _bar_NewID(playerid);

if(barid == -1)
{
print(" ERROR: MAX_PLAYER_BARS limit reached.");
return INVALID_PLAYER_BAR_ID;
}

pb_debug(" Creating progress bar %d at %f,%f width:%f height:%f max:%f direction:%d", barid, x, y, width, height, max, direction);

switch(direction)
{
case BAR_DIRECTION_RIGHT:
{
pbar_TextDraw = CreatePlayerTextDraw(playerid, x, y, "_");
PlayerTextDrawUseBox (playerid, pbar_TextDraw, 1);
PlayerTextDrawTextSize (playerid, pbar_TextDraw, x + width - 4.0, 0.0);
PlayerTextDrawLetterSize (playerid, pbar_TextDraw, 1.0, height / 10);
PlayerTextDrawBoxColor (playerid, pbar_TextDraw, 0x00000000 | (colour & 0x000000FF));

pbar_TextDraw = CreatePlayerTextDraw(playerid, x + 1.2, y + 2.15, "_");
PlayerTextDrawUseBox (playerid, pbar_TextDraw, 1);
PlayerTextDrawTextSize (playerid, pbar_TextDraw, x + width - 5.5, 0.0);
PlayerTextDrawLetterSize (playerid, pbar_TextDraw, 1.0, height / 10 - 0.35);
PlayerTextDrawBoxColor (playerid, pbar_TextDraw, (colour & 0xFFFFFF00) | (0x66 & ((colour & 0x000000FF) / 2)));

pbar_TextDraw = CreatePlayerTextDraw(playerid, x + 1.2, y + 2.15, "_");
PlayerTextDrawUseBox (playerid, pbar_TextDraw, 1);
PlayerTextDrawTextSize (playerid, pbar_TextDraw, pb_percent(x, width, max, 0.0, direction), 0.0);
PlayerTextDrawLetterSize (playerid, pbar_TextDraw, 1.0, height / 10 - 0.35);
PlayerTextDrawBoxColor (playerid, pbar_TextDraw, colour);
}

case BAR_DIRECTION_LEFT:
{
pbar_TextDraw = CreatePlayerTextDraw(playerid, x, y, "_");
PlayerTextDrawUseBox (playerid, pbar_TextDraw, 1);
PlayerTextDrawTextSize (playerid, pbar_TextDraw, x - width - 4.0, 0.0);
PlayerTextDrawLetterSize (playerid, pbar_TextDraw, 1.0, height / 10);
PlayerTextDrawBoxColor (playerid, pbar_TextDraw, 0x00000000 | (colour & 0x000000FF));

pbar_TextDraw = CreatePlayerTextDraw(playerid, x - 1.2, y + 2.15, "_");
PlayerTextDrawUseBox (playerid, pbar_TextDraw, 1);
PlayerTextDrawTextSize (playerid, pbar_TextDraw, x - width - 2.5, 0.0);
PlayerTextDrawLetterSize (playerid, pbar_TextDraw, 1.0, height / 10 - 0.35);
PlayerTextDrawBoxColor (playerid, pbar_TextDraw, (colour & 0xFFFFFF00) | (0x66 & ((colour & 0x000000FF) / 2)));

pbar_TextDraw = CreatePlayerTextDraw(playerid, x - 1.2, y + 2.15, "_");
PlayerTextDrawUseBox (playerid, pbar_TextDraw, 1);
PlayerTextDrawTextSize (playerid, pbar_TextDraw, pb_percent(x, width, max, 0.0, direction), 0.0);
PlayerTextDrawLetterSize (playerid, pbar_TextDraw, 1.0, height / 10 - 0.35);
PlayerTextDrawBoxColor (playerid, pbar_TextDraw, colour);
}

case BAR_DIRECTION_UP:
{
pbar_TextDraw = CreatePlayerTextDraw(playerid, x, y, "_");
PlayerTextDrawUseBox (playerid, pbar_TextDraw, 1);
PlayerTextDrawTextSize (playerid, pbar_TextDraw, x - width - 4.0, 0.0);
PlayerTextDrawLetterSize (playerid, pbar_TextDraw, 1.0, -((height / 10) * 1.02) -0.35);
PlayerTextDrawBoxColor (playerid, pbar_TextDraw, 0x00000000 | (colour & 0x000000FF));

pbar_TextDraw = CreatePlayerTextDraw(playerid, x - 1.2, y - 1.0, "_");
PlayerTextDrawUseBox (playerid, pbar_TextDraw, 1);
PlayerTextDrawTextSize (playerid, pbar_TextDraw, x - width - 2.5, 0.0);
PlayerTextDrawLetterSize (playerid, pbar_TextDraw, 1.0, -(height / 10.0) * 1.02);
PlayerTextDrawBoxColor (playerid, pbar_TextDraw, (colour & 0xFFFFFF00) | (0x66 & ((colour & 0x000000FF) / 2)));

pbar_TextDraw = CreatePlayerTextDraw(playerid, x - 1.2, y - 1.0, "_");
PlayerTextDrawUseBox (playerid, pbar_TextDraw, 1);
PlayerTextDrawTextSize (playerid, pbar_TextDraw, x - width - 2.5, 0.0);
PlayerTextDrawLetterSize (playerid, pbar_TextDraw, 0.0, -0.55);
PlayerTextDrawBoxColor (playerid, pbar_TextDraw, colour);
}

case BAR_DIRECTION_DOWN:
{
pbar_TextDraw = CreatePlayerTextDraw(playerid, x, y, "_");
PlayerTextDrawUseBox (playerid, pbar_TextDraw, 1);
PlayerTextDrawTextSize (playerid, pbar_TextDraw, x - width - 4.0, 0.0);
PlayerTextDrawLetterSize (playerid, pbar_TextDraw, 1.0, ((height / 10)) -0.35);
PlayerTextDrawBoxColor (playerid, pbar_TextDraw, 0x00000000 | (colour & 0x000000FF));

pbar_TextDraw = CreatePlayerTextDraw(playerid, x - 1.2, y + 1.0, "_");
PlayerTextDrawUseBox (playerid, pbar_TextDraw, 1);
PlayerTextDrawTextSize (playerid, pbar_TextDraw, x - width - 2.5, 0.0);
PlayerTextDrawLetterSize (playerid, pbar_TextDraw, 1.0, (height / 10.0) - 0.55);
PlayerTextDrawBoxColor (playerid, pbar_TextDraw, (colour & 0xFFFFFF00) | (0x66 & ((colour & 0x000000FF) / 2)));

pbar_TextDraw = CreatePlayerTextDraw(playerid, x - 1.2, y + 1.0, "_");
PlayerTextDrawUseBox (playerid, pbar_TextDraw, 1);
PlayerTextDrawTextSize (playerid, pbar_TextDraw, x - width - 2.5, 0.0);
PlayerTextDrawLetterSize (playerid, pbar_TextDraw, 0.0, -0.55);
PlayerTextDrawBoxColor (playerid, pbar_TextDraw, colour);
}
}

pbar_Data = x;
pbar_Data = y;
pbar_Data = width;
pbar_Data = height;
pbar_Data = colour;
pbar_Data = max;
pbar_Data = 0.0;
pbar_Data = direction;

#if defined _Y_ITERATE_LOCAL_VERSION
Iter_Add(pbar_Index, barid);
#else
pbar_Valid = true;
#endif

return PlayerBar:barid;
}

stock DestroyPlayerProgressBar(playerid, PlayerBar:barid)
{
if(!IsValidPlayerProgressBar(playerid, barid))
return 0;

PlayerTextDrawDestroy(playerid, pbar_TextDraw[_:barid]);
PlayerTextDrawDestroy(playerid, pbar_TextDraw[_:barid]);
PlayerTextDrawDestroy(playerid, pbar_TextDraw[_:barid]);

#if defined _Y_ITERATE_LOCAL_VERSION
Iter_Remove(pbar_Index, _:barid);
#else
pbar_Valid[_:barid] = false;
#endif

return 1;
}

stock ShowPlayerProgressBar(playerid, PlayerBar:barid)
{
if(!IsValidPlayerProgressBar(playerid, barid))
return 0;

PlayerTextDrawShow(playerid, pbar_TextDraw[_:barid]);
PlayerTextDrawShow(playerid, pbar_TextDraw[_:barid]);
PlayerTextDrawShow(playerid, pbar_TextDraw[_:barid]);

return 1;
}

stock HidePlayerProgressBar(playerid, PlayerBar:barid)
{
if(!IsValidPlayerProgressBar(playerid, barid))
return 0;

PlayerTextDrawHide(playerid, pbar_TextDraw[_:barid]);
PlayerTextDrawHide(playerid, pbar_TextDraw[_:barid]);
PlayerTextDrawHide(playerid, pbar_TextDraw[_:barid]);

return 1;
}

/*==============================================================================

Hooks and Internal

==============================================================================*/

#if defined _Y_ITERATE_LOCAL_VERSION

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
Iter_Init(pbar_Index);

#if defined ppb_OnFilterScriptInit
return ppb_OnFilterScriptInit();
#else
return 1;
#endif
}
#if defined _ALS_OnFilterScriptInit
#undef OnFilterScriptInit
#else
#define _ALS_OnFilterScriptInit
#endif

#define OnFilterScriptInit ppb_OnFilterScriptInit
#if defined ppb_OnFilterScriptInit
forward ppb_OnFilterScriptInit();
#endif

#else

public OnGameModeInit()
{
Iter_Init(pbar_Index);

#if defined ppb_OnGameModeInit
return ppb_OnGameModeInit();
#else
return 1;
#endif
}
#if defined _ALS_OnGameModeInit
#undef OnGameModeInit
#else
#define _ALS_OnGameModeInit
#endif

#define OnGameModeInit ppb_OnGameModeInit
#if defined ppb_OnGameModeInit
forward ppb_OnGameModeInit();
#endif

#endif

#endif

public OnPlayerDisconnect(playerid, reason)
{
#if defined _Y_ITERATE_LOCAL_VERSION
Iter_Clear(pbar_Index);
#else
for(new i; i < MAX_PLAYER_BARS; i++)
pbar_Valid[_:i] = false;
#endif

#if defined ppb_OnPlayerDisconnect
return ppb_OnPlayerDisconnect(playerid, reason);
#else
return 1;
#endif
}
#if defined _ALS_OnPlayerDisconnect
#undef OnPlayerDisconnect
#else
#define _ALS_OnPlayerDisconnect
#endif

#define OnPlayerDisconnect ppb_OnPlayerDisconnect
#if defined ppb_OnPlayerDisconnect
forward ppb_OnPlayerDisconnect(playerid, reason);
#endif

/*==============================================================================

Interface

==============================================================================*/

stock IsValidPlayerProgressBar(playerid, PlayerBar:barid)
{
#if defined _Y_ITERATE_LOCAL_VERSION
return Iter_Contains(pbar_Index, _:barid);
#else
if(!(PlayerBar:0 <= barid < PlayerBar:MAX_PLAYER_BARS))
return false;

return pbar_Valid[_:barid];
#endif
}

// pbar_posX
// pbar_posY
stock GetPlayerProgressBarPos(playerid, PlayerBar:barid, &Float:x, &Float:y)
{
if(!IsValidPlayerProgressBar(playerid, barid))
return 0;

x = pbar_Data[_:barid];
y = pbar_Data[_:barid];

return 1;
}

/*stock SetPlayerProgressBarPos(playerid, PlayerBar:barid, Float:x, Float:y)
{
if(!IsValidPlayerProgressBar(playerid, barid))
return false;

pbar_Data = x;
pbar_Data = y;

return true;
}*/

// pbar_width
stock Float:GetPlayerProgressBarWidth(playerid, PlayerBar:barid)
{
if(!IsValidPlayerProgressBar(playerid, barid))
return INVALID_PLAYER_BAR_VALUE;

return pbar_Data[_:barid];
}

/*stock SetPlayerProgressBarWidth(playerid, PlayerBar:barid, Float:width)
{
if(!IsValidPlayerProgressBar(playerid, barid))
return 0;

pbar_Data[_:barid] = width;

// TODO: Re-render

return 1;
}*/

// pbar_height
stock Float:GetPlayerProgressBarHeight(playerid, PlayerBar:barid)
{
if(!IsValidPlayerProgressBar(playerid, barid))
return INVALID_PLAYER_BAR_VALUE;

return pbar_Data[_:barid];
}

/*stock SetPlayerProgressBarHeight(playerid, PlayerBar:barid, Float:height)
{
if(!IsValidPlayerProgressBar(playerid, barid))
return 0;

pbar_Data[_:barid] = height;

// TODO: Re-render

return 1;
}*/

// pbar_colour
stock GetPlayerProgressBarColour(playerid, PlayerBar:barid)
{
if(!IsValidPlayerProgressBar(playerid, barid))
return 0;

return pbar_Data[_:barid];
}

stock SetPlayerProgressBarColour(playerid, PlayerBar:barid, colour)
{
if(!IsValidPlayerProgressBar(playerid, barid))
return 0;

pbar_Data[_:barid] = colour;
PlayerTextDrawBoxColor(playerid, pbar_TextDraw[_:barid], 0x00000000 | (colour & 0x000000FF));

PlayerTextDrawBoxColor(playerid, pbar_TextDraw[_:barid], (colour & 0xFFFFFF00) | (0x66 & ((colour & 0x000000FF) / 2)));

PlayerTextDrawBoxColor(playerid, pbar_TextDraw[_:barid], colour);

return 1;
}

// pbar_maxValue
stock Float:GetPlayerProgressBarMaxValue(playerid, PlayerBar:barid)
{
if(!IsValidPlayerProgressBar(playerid, barid))
return INVALID_PLAYER_BAR_VALUE;

return pbar_Data[_:barid];
}

stock SetPlayerProgressBarMaxValue(playerid, PlayerBar:barid, Float:max)
{
if(!IsValidPlayerProgressBar(playerid, barid))
return 0;

pbar_Data[_:barid] = max;
SetPlayerProgressBarValue(playerid, barid, pbar_Data[_:barid]);

return 1;
}

// pbar_progressValue
stock SetPlayerProgressBarValue(playerid, PlayerBar:barid, Float:value)
{
if(!IsValidPlayerProgressBar(playerid, barid))
return 0;

value = (value < 0.0) ? (0.0) : (value > pbar_Data[_:barid]) ? (pbar_Data[_:barid]) : (value);

PlayerTextDrawUseBox(playerid, pbar_TextDraw[_:barid], value > 0.0);

pbar_Data[_:barid] = value;

switch(pbar_Data[_:barid])
{
case BAR_DIRECTION_RIGHT, BAR_DIRECTION_LEFT:
{

PlayerTextDrawTextSize(playerid, pbar_TextDraw[_:barid],
pb_percent(
pbar_Data[_:barid],
pbar_Data[_:barid],
pbar_Data[_:barid],
value,
pbar_Data[_:barid]), 0.0);
}

case BAR_DIRECTION_UP, BAR_DIRECTION_DOWN:
{
PlayerTextDrawLetterSize(playerid, pbar_TextDraw[_:barid], 1.0,
pb_percent(
pbar_Data[_:barid],
pbar_Data[_:barid],
pbar_Data[_:barid],
value,
pbar_Data[_:barid]));
}
}

ShowPlayerProgressBar(playerid, barid);

return 1;
}

stock Float:GetPlayerProgressBarValue(playerid, PlayerBar:barid)
{
if(!IsValidPlayerProgressBar(playerid, barid))
return INVALID_PLAYER_BAR_VALUE;

return pbar_Data[_:barid];
}

// pbar_direction
stock GetPlayerProgressBarDirection(playerid, PlayerBar:barid)
{
if(!IsValidPlayerProgressBar(playerid, barid))
return 0;

return pbar_Data[_:barid];
}
/*
stock SetPlayerProgressBarDirection(playerid, PlayerBar:barid, direction)
{
if(!IsValidPlayerProgressBar(playerid, barid))
return 0;

pbar_Data[_:barid] = direction;

// TODO: Re-render

return 1;
}
*/

Neke slike/video za lakse dobivanje pomoci(neobavezno):
Slike grešaka:
http://prntscr.com/brgtls
86-ta linija:
http://prntscr.com/brgtvn
350-ta linija:
http://prntscr.com/brgu8v
expressoboy123
5
Godfather
11. Jul 2016.
Gde si ti tu definisao id dialoga?
JucyMonster
2
Rookie
11. Jul 2016.
Tosic ツ wrote on July 11, 2016, 11:35 am:
Gde si ti tu definisao id dialoga?


http://prntscr.com/brgv8q
Ovaj id?
JucyMonster
2
Rookie
11. Jul 2016.
Izvinjavam se za DP, nesto mi je progress inc imao gresku, samo sam ponovo skinuo i proradilo je, pozz

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha