Progress bar doesn't shows - 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: Progress bar doesn't shows (
/showthread.php?tid=662078)
Progress bar doesn't shows -
GameOvr - 23.12.2018
I made a rob system,
When player aims on a shop keeper(actor) It is showing a progress bar and after progress bar filled it creates a pickup infront of player (pickup for robbed cash)
Problem is progress bar not showing please help me
My code __
pawn Code:
new PlayerBar:rbar[MAX_PLAYERS];
//under player connect
rbar[playerid] = CreatePlayerProgressBar(playerid, 493.000000, 369.000000, 101.000000, 3.200000, 16711935, 18.0000, 0);
timer calling each second
pawn Code:
forward RobTimer();
public RobTimer()
{
for(new i = 0; i < MAX_ACTORS; i++)
{
if(i != INVALID_ACTOR_ID)
{
if(JustRobbed[i] == false)
{
if(robber[i] != -1) // shop is under rob
{
if(GetPlayerTargetActor(robber[i]) == i)
{
robtime[i] ++;
SetPlayerProgressBarValue(robber[i], rbar[robber[i]], robtime[i]);
if(robtime[i] == ROB_SUCCESS_TIME) // successfully robbed
{
ClearActorAnimations(i);
HidePlayerProgressBar(robber[i], rbar[robber[i]]);
JustRobbed[i] = true;
SetTimerEx("EndJustRobbed", SHOP_ROB_REST * 1000, false, "i", i);
USERINFO[robber[i]][robbs] ++;
robtime[i] = -1;
new Float:x, Float:y, Float:z;
GetPlayerPos(robber[i], x, y, z);
robpick[i] = CreatePickup(1272, 8, x + 2, y, z, 0);
}
}
else //failed to rob
{
ClearActorAnimations(i);
HidePlayerProgressBar(robber[i], rbar[robber[i]]);
}
}
else // checking if somebody is robbing
{
foreach(new j : Player)
{
if(GetPlayerTargetActor(j) == i)
{
robber[i] = j;
robtime[i] = 0;
ShowPlayerProgressBar(j, rbar[j]);
ApplyActorAnimation(i, "ped", "handsup", 0, 0, 0, 0, 0, 1);
}
}
}
}
else
{
foreach(new j : Player)
{
if(GetPlayerTargetActor(j) == i) return SendClientMessage(j, COLOR_ERROR, "Sorry, The shop has been robbed before few minutes");
}
}
}
}
return 1;
}
Re: Progress bar doesn't shows -
GameOvr - 24.12.2018
bump! anyone?
Re: Progress bar doesn't shows -
Pottus - 24.12.2018
-----
Re: Progress bar doesn't shows -
Hunud - 24.12.2018
uhm.
Re: Progress bar doesn't shows -
GameOvr - 24.12.2018
Quote:
Originally Posted by Pottus
-----
|
I thought you are retired from samp scene anyway don't u have any ideas that wht may cause this error