[Tutorial] Criando ProgressBar By. Paulo

9 de jan. de 2013.

Bom, vídeo aula criando uma ProgressBar, espero que seja útil para você.

Video:

Creditos: paulor

pawn Código:
new Text: pTd[3]; public OnGameModeInit() {     SetGameModeText("Blank Script");     AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);         pTd[0] = TextDrawCreate(38.000000, 320.000000, "_"); //Fundo Preto     TextDrawLetterSize(pTd[0], 0.500000, 1.100000);     TextDrawUseBox(pTd[0], 1);     TextDrawBoxColor(pTd[0], 255);     TextDrawTextSize(pTd[0], 142.000000, 0.000000);     pTd[1] = TextDrawCreate(39.000000, 322.000000, "_"); //Fundo da Progress     TextDrawLetterSize(pTd[1], 0.500000, 0.699999);     TextDrawUseBox(pTd[1], 1);     TextDrawBoxColor(pTd[1], (0x99 | (~0xFF & 0xFF0000FF)));     TextDrawTextSize(pTd[1], 141.000000, 0.000000);     pTd[2] = TextDrawCreate(39.000000, 322.000000, "_"); //Progress     TextDrawLetterSize(pTd[2], 0.500000, 0.699999);     TextDrawUseBox(pTd[2], 1);     TextDrawBoxColor(pTd[2], 0xFF0000FF);     TextDrawTextSize(pTd[2], 36.000000, 0.000000); //102px     return 1; } forward ProgrecoBar(playerid); public ProgrecoBar(playerid) {     static Float: Progress;     TextDrawTextSize(pTd[2], (39.0 + ((102.0 * ++Progress) / 100)), 0.0);     TextDrawShowForPlayer(playerid, pTd[2]);     if(Progress < 100.0) SetTimerEx("ProgrecoBar", 100, false, "i", playerid);     //else - Terminou o Progresso.     return 1; } public OnPlayerConnect(playerid) {     TextDrawShowForPlayer(playerid, pTd[0]);     TextDrawShowForPlayer(playerid, pTd[1]);     TextDrawShowForPlayer(playerid, pTd[2]);     return 1; } public OnPlayerCommandText(playerid, cmdtext[]) {     if(!strcmp("/iniciar", cmdtext)) {         SetTimerEx("ProgrecoBar", 100, false, "i", playerid);         SendClientMessage(playerid, -1, "Progresso Iniciado!!");         return 1;     }     return 0; }

0 comentários:

Postar um comentário