08.06.2013, 21:11
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:
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
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;
}
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