Вход

Просмотр полной версии : [Вопрос] Прогресс бар



SteveStage
30.12.2019, 21:30
Вот, к примеру, создание текстдравов прогресс бара голода:

stock TD_Hungry(playerid)
{
td_pb_hungry[0] = CreatePlayerTextDraw(playerid, 546.295776, 42.583351, "LD_SPAC:white");
PlayerTextDrawLetterSize(playerid, td_pb_hungry[0], 0.000000, 0.000000);
PlayerTextDrawTextSize(playerid, td_pb_hungry[0], 61.376327, -9.916667);
PlayerTextDrawAlignment(playerid, td_pb_hungry[0], 1);
PlayerTextDrawColor(playerid, td_pb_hungry[0], 255);
PlayerTextDrawFont(playerid, td_pb_hungry[0], 4);

td_pb_hungry[1] = CreatePlayerTextDraw(playerid, 548.169799, 35.000000, "LD_SPAC:white");
PlayerTextDrawLetterSize(playerid, td_pb_hungry[1], 0.000000, 0.000000);
PlayerTextDrawTextSize(playerid, td_pb_hungry[1], 57.159606, 5.250000);
PlayerTextDrawAlignment(playerid, td_pb_hungry[1], 1);
PlayerTextDrawColor(playerid, td_pb_hungry[1], COLOR_ORANGE);
PlayerTextDrawFont(playerid, td_pb_hungry[1], 4);
}

А можно ли сделать так, чтобы td_pb_hungry[1] (текстдрав внутренности бара) сужался в зависимости от какого-либо значения? К примеру, передавать в сток TD_Hungry аргумент Float:value, который перед этим грузить из бд, и в зависимости от значения менять длину полоски. Но как это реализовать?

execution
31.12.2019, 00:07
По-моему тебе уже помогали с этим вопросом.

Есть готовая библиотека где это уже всё есть. *тык* (https://github.com/Southclaws/samp-progress/blob/master/playerprogress.inc)

SteveStage
31.12.2019, 00:36
По-моему тебе уже помогали с этим вопросом.

Нет


Есть готовая библиотека где это уже всё есть. *тык* (https://github.com/Southclaws/samp-progress/blob/master/playerprogress.inc)

Лучший способ, апплодирую стоя

C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(67) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(68) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(141) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(141) : warning 213: tag mismatch: expected tag none ("_"), but found "PlayerText"
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(142) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")

Kovshevoy
31.12.2019, 01:29
Нет



Лучший способ, апплодирую стоя

C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(67) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(68) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(141) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(141) : warning 213: tag mismatch: expected tag none ("_"), but found "PlayerText"
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(142) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")

А пофиксить религия не позволяет? Всего лишь добавить тэг PlayerText: или же использовать _:
Тяжело, блин(

SteveStage
31.12.2019, 17:54
А пофиксить религия не позволяет? Всего лишь добавить тэг PlayerText: или же использовать _:
Тяжело, блин(

Вот только к какой из переменных это относится? Их там несколько вообще-то на одной строке

Kovshevoy
31.12.2019, 18:29
Вот только к какой из переменных это относится? Их там несколько вообще-то на одной строке

Ищи объявление каждой переменной и глянь где есть тэги, плюс чекни функции где есть предупреждения, там указывается у какого аргумента тэг есть.

SteveStage
31.12.2019, 18:44
Ищи объявление каждой переменной и глянь где есть тэги

static
pbar_Data[MAX_PLAYERS][MAX_PLAYER_BARS][E_BAR_DATA],
pbar_TextDraw[MAX_PLAYERS][MAX_PLAYER_BARS][E_BAR_TEXT_DRAW];

Вот где ты тут видишь причину? Пробовал pbar_Data и pbar_TextDraw тэг PlayerText: выставлять - варнинги не пропадали, тогда в чем проблема?

for(new i; i < MAX_PLAYER_BARS; i++)
pbar_Data[playerid][_:i][pbar_valid] = false;

А тут где проблема?


плюс чекни функции где есть предупреждения, там указывается у какого аргумента тэг есть.

На функции варнинги не идут, именно на тэги

Kovshevoy
31.12.2019, 19:10
for(new i; i < MAX_PLAYER_BARS; i++)
pbar_Data[playerid][_:i][pbar_valid] = false;



for(new i; i < MAX_PLAYER_BARS; i++)
pbar_Data[playerid][PlayerText:i][pbar_valid] = false;

SteveStage
31.12.2019, 19:16
Допустим, но остается еще 3 варнинга

1)

for(new PlayerText:i; i < MAX_PLAYER_BARS; i++)
pbar_Data[playerid][i][pbar_valid] = false;

C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(141) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")

2, 3)

static
pbar_Data[MAX_PLAYERS][MAX_PLAYER_BARS][E_BAR_DATA],
pbar_TextDraw[MAX_PLAYERS][MAX_PLAYER_BARS][E_BAR_TEXT_DRAW];

C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(67) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(68) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")

UPD: Получилось убрать варнинги, изменив дефайн MAX_PLAYER_BARS c
#define MAX_PLAYER_BARS (MAX_PLAYER_TEXT_DRAWS / 3)
на
#define MAX_PLAYER_BARS (MAX_PLAYER_TEXT_DRAWS / PlayerText:3)
но я не уверен, что такой вариант работоспособный
UPD2: И в правду, при использовании появилось кучу варнингов

Kovshevoy
31.12.2019, 19:25
static pbar_Data[MAX_PLAYERS][MAX_PLAYER_BARS][E_BAR_DATA],
PlayerText: pbar_TextDraw[MAX_PLAYERS][MAX_PLAYER_BARS][E_BAR_TEXT_DRAW];


Допустим так.

SteveStage
31.12.2019, 19:27
При использовании стандартного инклуда/измененного инклуда появляются эти варнинги:

C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(67) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(68) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(75) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(75) : warning 213: tag mismatch: expected tag none ("_"), but found "PlayerText"
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(77) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(81) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(81) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(84) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(85) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(86) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(87) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(88) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(90) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(91) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(92) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(93) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(94) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(96) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(97) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(98) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(99) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(101) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(102) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(103) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(104) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(105) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(106) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(107) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(141) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(141) : warning 213: tag mismatch: expected tag none ("_"), but found "PlayerText"
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(142) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")

Kovshevoy
31.12.2019, 19:43
При использовании стандартного инклуда/измененного инклуда появляются эти варнинги:

C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(67) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(68) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(75) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(75) : warning 213: tag mismatch: expected tag none ("_"), but found "PlayerText"
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(77) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(81) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(81) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(84) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(85) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(86) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(87) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(88) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(90) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(91) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(92) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(93) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(94) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(96) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(97) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(98) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(99) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(101) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(102) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(103) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(104) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(105) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(106) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(107) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(141) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(141) : warning 213: tag mismatch: expected tag none ("_"), but found "PlayerText"
C:\Users\HP\Desktop\Äîêóìåíòû\2) Pawn\Ìîè ìîäû\Junction RP\pawno\include\progress.inc(142) : warning 213: tag mismatch: expected tag "PlayerText", but found none ("_")

Логично, теперь в проблемных местах сделай тэги PlayerText: и всё. Где-то есть пропуск тэга _: и его тоже замени.