how to make progress bar load for 25 seconds in checkpoint
#1

hi guys i want to make a bar which will load from 0 to 25.
i know how to create a progress bar.
The thing i dont know is how to make it load from 0 to 25 if player is in checkpoint
Please help me i will +Rep u alot
Reply
#2

Have you actually attempted to ****** (search) this?
Reply
#3

Use timers, here example from my mod:

https://sampwiki.blast.hk/wiki/SetTimerEx

Quote:

SetTimerEx("LoadTruck", 1000, 0, "d", playerid);

1000 is on milliseconds so it equal 1 second, for you 25000
Reply
#4

so how do i do it
i mean
how do i use it in this
pawn Код:
if(UnderAttack[AA] == 0)
        {
            if(!IsPlayerInAnyVehicle(playerid))
            {
                UnderAttack[AA] = 1;
                timer[playerid][AA] = SetTimerEx("AATimer", 25000, false,"i",playerid);
                Captured[playerid][AA] = 0;
                SendClientMessage(playerid, 0xFFFFFFFF,"| Stay in this checkpoint for 25 seconds to capture it! |");
                if(pTeam[playerid] == TEAM_USA)
                {
                  GangZoneFlashForAll(Zone[AA], TEAM_COLOR_USA);
                }
                else if(pTeam[playerid] == TEAM_RUSSIA)
                {
                  GangZoneFlashForAll(Zone[AA], TEAM_COLOR_RUSSIA);
                }
                else if(pTeam[playerid] == TEAM_PAKISTAN)
                {
                  GangZoneFlashForAll(Zone[AA], TEAM_COLOR_PAKISTAN);
                }
                else if(pTeam[playerid] == TEAM_EUROPE)
                {
                  GangZoneFlashForAll(Zone[AA], TEAM_COLOR_EUROPE);
                }
                else if(pTeam[playerid] == TEAM_INDIA)
                {
                  GangZoneFlashForAll(Zone[AA], TEAM_COLOR_INDIA);
                }
                else if(pTeam[playerid] == TEAM_ASIA)
                {
                  GangZoneFlashForAll(Zone[AA],TEAM_COLOR_ASIA);
                }
how do i script bar so it goes from 0 to 25 in 25 seconds
Reply
#5

Код:
if(UnderAttack[AA] == 0)
        {
            if(!IsPlayerInAnyVehicle(playerid))
            {
                UnderAttack[AA] = 1;
                timer[playerid][AA] = SetTimerEx("AATimer", 25000, false,"i",playerid);
                AATimer[playerid] = CreateProgressBar(258.00, 137.00, 131.50, 3.19, COLOR_GREEN, 100.0);
	        SetProgressBarValue(AATimer[playerid], 100.0);
		ShowProgressBarForPlayer(playerid, AATimer[playerid]);
		SetTimerEx("AATimer", 25000, 0, "dd", playerid);
                Captured[playerid][AA] = 0;
                SendClientMessage(playerid, 0xFFFFFFFF,"| Stay in this checkpoint for 25 seconds to capture it! |");
                if(pTeam[playerid] == TEAM_USA)
                {
                  GangZoneFlashForAll(Zone[AA], TEAM_COLOR_USA);
                }
                else if(pTeam[playerid] == TEAM_RUSSIA)
                {
                  GangZoneFlashForAll(Zone[AA], TEAM_COLOR_RUSSIA);
                }
                else if(pTeam[playerid] == TEAM_PAKISTAN)
                {
                  GangZoneFlashForAll(Zone[AA], TEAM_COLOR_PAKISTAN);
                }
                else if(pTeam[playerid] == TEAM_EUROPE)
                {
                  GangZoneFlashForAll(Zone[AA], TEAM_COLOR_EUROPE);
                }
                else if(pTeam[playerid] == TEAM_INDIA)
                {
                  GangZoneFlashForAll(Zone[AA], TEAM_COLOR_INDIA);
                }
                else if(pTeam[playerid] == TEAM_ASIA)
                {
                  GangZoneFlashForAll(Zone[AA],TEAM_COLOR_ASIA);
                }
Reply
#6

Quote:
Originally Posted by lider1241
Посмотреть сообщение
Код:
if(UnderAttack[AA] == 0)
        {
            if(!IsPlayerInAnyVehicle(playerid))
            {
                UnderAttack[AA] = 1;
                timer[playerid][AA] = SetTimerEx("AATimer", 25000, false,"i",playerid);
                AATimer[playerid] = CreateProgressBar(258.00, 137.00, 131.50, 3.19, COLOR_GREEN, 100.0);
	        SetProgressBarValue(AATimer[playerid], 100.0);
		ShowProgressBarForPlayer(playerid, AATimer[playerid]);
		SetTimerEx("AATimer", 25000, 0, "dd", playerid);
                Captured[playerid][AA] = 0;
                SendClientMessage(playerid, 0xFFFFFFFF,"| Stay in this checkpoint for 25 seconds to capture it! |");
                if(pTeam[playerid] == TEAM_USA)
                {
                  GangZoneFlashForAll(Zone[AA], TEAM_COLOR_USA);
                }
                else if(pTeam[playerid] == TEAM_RUSSIA)
                {
                  GangZoneFlashForAll(Zone[AA], TEAM_COLOR_RUSSIA);
                }
                else if(pTeam[playerid] == TEAM_PAKISTAN)
                {
                  GangZoneFlashForAll(Zone[AA], TEAM_COLOR_PAKISTAN);
                }
                else if(pTeam[playerid] == TEAM_EUROPE)
                {
                  GangZoneFlashForAll(Zone[AA], TEAM_COLOR_EUROPE);
                }
                else if(pTeam[playerid] == TEAM_INDIA)
                {
                  GangZoneFlashForAll(Zone[AA], TEAM_COLOR_INDIA);
                }
                else if(pTeam[playerid] == TEAM_ASIA)
                {
                  GangZoneFlashForAll(Zone[AA],TEAM_COLOR_ASIA);
                }
Can u give me the full code including
new ...
forward...
etc
I learn from watching
Thanks
Reply
#7

I forgot the include lol

https://sampforum.blast.hk/showthread.php?tid=113443

Download it and #include <progress> in your script/filterscript

All the undefined symbols will be gone
Reply
#8

Can i get full Code with everything on how to make timer of progress bar and also progress bar should start from 0 and go till 25 and should be done in 25 seconds
Reply
#9

On your top of your script:

Код:
forward AATimer(playerid);
AATimer(playerid)
{
    new vehicleid = GetPlayerVehicleID(playerid);
	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	}
 	CreateProgressBar(AATimer[playerid]);
	AATimer[playerid] = 1;
	return 1;
}

Код:
if(UnderAttack[AA] == 0)
        {
            if(!IsPlayerInAnyVehicle(playerid))
            {
                UnderAttack[AA] = 1;
                timer[playerid][AA] = SetTimerEx("AATimer", 25000, false,"i",playerid);
                AATimer[playerid] = CreateProgressBar(258.00, 137.00, 131.50, 3.19, COLOR_GREEN, 100.0);
	        SetProgressBarValue(AATimer[playerid], 100.0);
		ShowProgressBarForPlayer(playerid, AATimer[playerid]);
		SetTimerEx("AATimer", 25000, 0, "dd", playerid);
                Captured[playerid][AA] = 0;
                SendClientMessage(playerid, 0xFFFFFFFF,"| Stay in this checkpoint for 25 seconds to capture it! |");
                if(pTeam[playerid] == TEAM_USA)
                {
                  GangZoneFlashForAll(Zone[AA], TEAM_COLOR_USA);
                }
                else if(pTeam[playerid] == TEAM_RUSSIA)
                {
                  GangZoneFlashForAll(Zone[AA], TEAM_COLOR_RUSSIA);
                }
                else if(pTeam[playerid] == TEAM_PAKISTAN)
                {
                  GangZoneFlashForAll(Zone[AA], TEAM_COLOR_PAKISTAN);
                }
                else if(pTeam[playerid] == TEAM_EUROPE)
                {
                  GangZoneFlashForAll(Zone[AA], TEAM_COLOR_EUROPE);
                }
                else if(pTeam[playerid] == TEAM_INDIA)
                {
                  GangZoneFlashForAll(Zone[AA], TEAM_COLOR_INDIA);
                }
                else if(pTeam[playerid] == TEAM_ASIA)
                {
                  GangZoneFlashForAll(Zone[AA],TEAM_COLOR_ASIA);
                }
Reply
#10

why did u check if hes in vehicle
i want to make that if player enters checkpoint
it starts showing him bar for 25 seconds and the bar loads from 0 to 25
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)