SA-MP Forums Archive
Progress2.inc warning - 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)
+--- Thread: Progress2.inc warning (/showthread.php?tid=580184)



Progress2.inc warning - fahlevy - 03.07.2015

hello.
today i will create progress bar.
So i download progressbar by [HLF]Southclaw
here https://sampforum.blast.hk/showthread.php?tid=537468

When i compile i got warning..
Код:
D:\FahLevY\PROJECT SERVER GUE !!!\Project Specially\Server Jadi!\COD\pawno\include\progress2.inc(152) : warning 205: redundant code: constant expression is zero
D:\FahLevY\PROJECT SERVER GUE !!!\Project Specially\Server Jadi!\COD\pawno\include\progress2.inc(240) : warning 205: redundant code: constant expression is zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.

This is the cooding of progress2.inc

here the code line 152
Код:
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)) ///// line 152
		return INVALID_PLAYER_BAR_ID;

	new barid = _bar_NewID(playerid);

	if(barid == -1)
	{
		print("[CreatePlayerProgressBar] ERROR: MAX_PLAYER_BARS limit reached.");
		return INVALID_PLAYER_BAR_ID;
	}
here the code line 240
Код:
_RenderBar(playerid, barid, update = false)
{
	if(!IsPlayerConnected(playerid))  ////line 240
		return false;

	if(!IsValidPlayerProgressBar(playerid, PlayerBar:barid))
		return false;

	PlayerTextDrawDestroy(playerid, pbar_TextDraw[playerid][barid][pbar_back]);
	PlayerTextDrawDestroy(playerid, pbar_TextDraw[playerid][barid][pbar_fill]);
	PlayerTextDrawDestroy(playerid, pbar_TextDraw[playerid][barid][pbar_main]);
Please help ,how to fix that ..
thank you


Re: Progress2.inc warning - fahlevy - 03.07.2015

somebody help please ...


Re: Progress2.inc warning - fahlevy - 03.07.2015

guys?? help please


Re: Progress2.inc warning - fahlevy - 05.07.2015

so what the problem,i was updated the ut_mock_players.inc .its still same problem, got 2 warning..


Re: Progress2.inc warning - LovelySoomro - 14.02.2016

Quote:

stock PlayerBar:CreatePlayerProgressBar(playerid, Float, Float:y, Float:width = 55.5, Float:height = 3.2, colour = 0xFF1C1CFF, Float:max = 100.0, direction = BAR_DIRECTION_RIGHT)
{

new barid = _bar_NewID(playerid);

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

Quote:

_RenderBar(playerid, barid, update = false)
{

if(!IsValidPlayerProgressBar(playerid, PlayerBar:barid))
return false;

PlayerTextDrawDestroy(playerid, pbar_TextDraw[playerid][barid][pbar_back]);
PlayerTextDrawDestroy(playerid, pbar_TextDraw[playerid][barid][pbar_fill]);
PlayerTextDrawDestroy(playerid, pbar_TextDraw[playerid][barid][pbar_main]);

fixed