[Ajuda] ProgressBar
#1

Ola a todos, estive vendo uns tutoriais de como fazer progressbar mas deu tudo errado, nгo consigo resolver meu problema, entгo estou aqui pedindo ajuda.

Objetivo:
Uma Progressbar que indique o progresso do level, o player upa a cada 1 hora jogada, e a progressbar iria acompanhar esse desempenho

Cуdigo:
Cуdigo logo abaixo:
pawn Код:
//ongamemodeinit
        segundos = SetTimer("SegundoaMais",10000,1);

    progress0 = TextDrawCreate(135.000000, 437.000000, "_"); // BORDA DA PROGRESS
    TextDrawLetterSize(progress0, 0.500000, 0.699999);
    TextDrawUseBox(progress0, 1);
    TextDrawBoxColor(progress0, 255);
    TextDrawTextSize(progress0, 37.000000, 2.000000);

    progress1 = TextDrawCreate(133.000000, 439.000000, "_"); // FUNDO DA PROGRESSBAR
    TextDrawLetterSize(progress1, 0.500000, 0.299999);
    TextDrawUseBox(progress1, 1);
    TextDrawBoxColor(progress1, 0xFF000099);
    TextDrawTextSize(progress1, 39.000000, 2.000000);
//--

//onplayerconnect..
    progress2[playerid] = TextDrawCreate(133.000000, 439.000000, "_"); // PROGRESSBAR
    TextDrawLetterSize(progress2[playerid], 0.500000, 0.299999);
    TextDrawUseBox(progress2[playerid], 1);
    TextDrawBoxColor(progress2[playerid], 0xFF0000FF);
    TextDrawTextSize(progress2[playerid], 39.000000, 2.000000); //94 px

    TextDrawShowForPlayer(playerid, progress0);
    TextDrawShowForPlayer(playerid, progress1);
//--


//onplayerspawn..
TextDrawTextSize(progress2[playerid], 39 +((94 * PlayerInfo[playerid][Segundos]) / 360), 0.0);
TextDrawShowForPlayer(playerid, progress2[playerid]);
//--

forward SegundoaMais();
public SegundoaMais()
{
    for ( new slots = GetMaxPlayers ( ), i; i < slots; i++  )
    {
        if(!logado[i])
        {
            PlayerInfo[i][Segundos] ++;
         
            TextDrawTextSize(progress2[i], 39 + ((94 * PlayerInfo[i][Segundos]) / 100), 0.0);
            TextDrawShowForPlayer(i, progress2[i]);
            if(PlayerInfo[i][Segundos] >= 360)
            {
                PlayerInfo[i][Segundos] = 0;
                HorasUP(i);
            }
        }
    }
    return 1;
}
Erro:
O cуdigo compila corretamente, porem na hora de por em pratica o progresso esta indo para o outro lado e nгo condiz com a variavel segundos
Reply
#2

eu costumo usar desse modo. https://sampforum.blast.hk/showthread.php?tid=113443
Reply
#3

Certifique-se de mostrar o novo valor da progress bar ao player quando ela atualizar...
Reply
#4

Quote:
Originally Posted by Blix
Посмотреть сообщение
pensei em utilizar de inicio, mas teria problemas na coordenada, uma vez que o progressbar maker deles nгo esta Funcionando.

alguem?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)